Losing php session intermittently #3372

Closed
wiad opened this Issue Apr 14, 2016 · 4 comments

Projects

None yet

2 participants

@wiad
Contributor
wiad commented Apr 14, 2016

I've had this issue ever since I first installed LibreNMS, both with mysql auth driver and AD auth driver. The problem is that I'm getting logged out suddenly and intermittently. There is no pattern in this, sometimes my session is alive for hours and sometimes I'm getting logged out pretty much instantly. Clicking the 'remember me' box makes no difference.

Debugging shows that when the problem occurs the php session is empty when authentication is attempted. After many attempts to solve this it finally seems to work after commenting out the line
@ini_set('session.gc_maxlifetime', '0');

in html/includes/authenticate.inc.php. Doesn't make sense to me because the above is supposed to disable session garbage collection entirely, but I'm not very well versed with php sessions.

Anyone else having problems with this? Anyone more experienced with php sessions that can explain why commenting out the above would solve the problem for me?

@laf
Member
laf commented Apr 14, 2016

Check the session.save_path in php.ini, make sure it's somewhere writable by web server

@wiad
Contributor
wiad commented Apr 14, 2016

I've googled a good deal about lost php sessions and the session.save_path is a recurring culprit among them. For me, however, fiddling with this has made no difference.

@wiad
Contributor
wiad commented Apr 15, 2016

I've been running with my modification for over 12hrs and not had one single logout.

I just removed my comment of
@ini_set('session.gc_maxlifetime', '0');

restarted apache, removed my existing session and logged in. I've had two logouts within one hour. This is on a RHEL7 box.

I find very little documentation about setting session.gc_maxlifetime to '0', but if noone else is having this problem there must be something in my environment. I've had LibreNMS installed on two separate servers and had the problem on both (both are RHEL7).

@laf
Member
laf commented Apr 15, 2016

Others have mentioned of similar issues. I'm not sure why that's there from memory so it possibly could be removed.

@f0o f0o closed this in #3484 May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment