Created attachment 8553 [details] [review] Bug 7810 - C4/Auth.pm - on pack restart session is undefined So we shouldn't try to delete it. This produces application error instead of redirection to login page. I had similar problems with CGI, especially when session in browser is still active, and one on filesystem or database is already expired.
Dobrica, what do you mean by "restart session"? Restart plack ? i did it but didn't get application error
My assumption was that it happends when browser still has cookie and session is already expired, but I'm unable to reproduce it fiddeling with session files manually. I will mark it INVALID and wait for it to happen again :-)
I got lucky (kind of). I restarted plack (using plackup only, not starman) and got following error on /cgi-bin/koha/mainpage.pl Can't call method "delete" on an undefined value at /srv/koha/C4/Auth.pm line 693, <DATA> line 522. at /srv/koha/mainpage.pl line 67 Since my patch fixes that line, I'm reopening the bug. Only way to recover from this error is to manually delete cookie which is not really good solution for users. My session looks very strange: dpavlin@koha-dev:/tmp$ sudo cat /tmp/cgisess_b77b83762178c18a0e7a3ac4f4e50738 --- _SESSION_ATIME: '1332851288' _SESSION_CTIME: '1332851288' _SESSION_ID: b77b83762178c18a0e7a3ac4f4e50738 _SESSION_REMOTE_ADDR: 193.198.212.4 and corrent time on system is: dpavlin@koha-dev:/tmp$ perl -e 'print time(),$/' 1332852562 My $timeout is 3600 which doesn't really explain why I end up in this code path since 1332852562 - 1332851288 = 1274
I can easily reproduce this bug by changing Koha site for plack using tools from Bug 7844
Dobrica how can you do that. I start koha using your tools from Bug 7844. But i still can't reproduce the bug ...
1. start one site using plack ./opac-plack.sh site1 2. login into site1 http://koha-dev.example.com:5000/ 3. stop plack and start another site, start another site ./opac-plack.sh site2 4. reload page = bug Work-around this bug is to use wildcard DNS with something like *.koha-dev.example.com and then use different URLs for each site so browser will do cookie scoping for us, e.g. site1.koha-dev.example.com site2.koha-dev.example.com However, we might also change our cookie name (CGISESSID) to something else: a) site name (if we want to allow single login for opac and intranet) or b) site name+port (if we want separate logins) But that's probably for another bug.
Created attachment 10120 [details] [review] Bug 7810 - C4/Auth.pm - on plack restart session is undefined So we shouldn't try to delete it. This produces application error instead of redirection to login page. I had similar problems with CGI, especially when session in browser is still active, and one on filesystem or database is already expired. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Solved the problem when my Plack installation started acting up due to stale cookies.
QA comment: tiny patch that can't be harmfull in CGI mode, as it just add a test
There have been no further reports of problems so I am marking this bug resolved.