Bug 16714 - Unexpected logout with "IP address change"
Summary: Unexpected logout with "IP address change"
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-11 14:06 UTC by Jonathan Druart
Modified: 2020-01-06 20:15 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-06-11 14:06:46 UTC
I get a new issue (not sure since when) under Plack:
I am logged out with "IP address change" just after the first login.

To reproduce:
- logout
- restart plack
- login
- click somewhere
=> You will be logged out

I have tried to debug:
diff --git a/C4/Auth.pm b/C4/Auth.pm
index 985bd39..a494ddf 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -818,6 +818,9 @@ sub checkauth {
             $userid      = $s_userid;
             $sessiontype = $session->param('sessiontype') || '';
         }
+
+        warn $ip;
+        warn $ENV{REMOTE_ADDR};
         if ( ( $query->param('koha_login_context') && ( $q_userid ne $s_userid ) )
             || ( $cas && $query->param('ticket') && !C4::Context->userenv->{'id'} )
             || ( $shib && $shib_login && !$logout && !C4::Context->userenv->{'id'} )


I get:
After the login:
  $ip=undef, $ENV{REMOTE_ADDR}=192.168.254.1
After the click producing the logout:
  $ip=192.168.254.1, $ENV{REMOTE_ADDR}=127.0.0.1
After the second login:
  $ip=127.0.0.1, $ENV{REMOTE_ADDR}=127.0.0.1
Comment 1 Jonathan Druart 2016-06-11 14:07:11 UTC
Ha, you need to set SessionRestrictionByIP
Comment 2 Jonathan Druart 2016-06-11 14:14:03 UTC
Before the first login you need to hit /, not the mainpage with the logout.x param

It seems that it exists on 3.22.x and 3.20.x as well.
Not sure if this is important, maybe dependent to my config.
Comment 3 Katrin Fischer 2019-02-05 06:49:10 UTC
Hi Jonathan, can this be closed? It's from 2016 and I am not aware of any issues with logouts under Plack at the moment.
Comment 4 Jonathan Druart 2019-02-16 16:04:56 UTC
I cannot longer recreate, closing.