Soldato
- Joined
- 3 Jun 2005
- Posts
- 3,351
- Location
- The South
Hi all,
I've developed a login script based around sessions, the issue i'm having is that sessions are expiring too early at around 30mins (although it's a bit random, could be 5mins could be an hour) instead of 2hrs set by 'session.gc_maxlifetime' in the php.ini file (this is hosted with TsoHost on their clustered servers, so have a customer ini file and yes the session.save_path is correct as stated on their forums).
The PHP session/cookies settings -

I've been hunting around google, php.net and a load of PHP forums but it just seems to be full of people in similar situations and i just keep finding conflicting information like whether 'session.gc_maxlifetime' is the inactivity timeout of the session (by last_modified) or whether this is the timeout from when the session was created (as stated in the php.ini file).
Has anyone got any ideas regarding this? As i've completely hit a brick wall and as last resorts the only option seems to be to re-write the authentication side of things to use cookies (has been recommended a few times on other forums), which i've tried to stay away from due to security.
Cheers for any help on this though
I've developed a login script based around sessions, the issue i'm having is that sessions are expiring too early at around 30mins (although it's a bit random, could be 5mins could be an hour) instead of 2hrs set by 'session.gc_maxlifetime' in the php.ini file (this is hosted with TsoHost on their clustered servers, so have a customer ini file and yes the session.save_path is correct as stated on their forums).
The PHP session/cookies settings -

I've been hunting around google, php.net and a load of PHP forums but it just seems to be full of people in similar situations and i just keep finding conflicting information like whether 'session.gc_maxlifetime' is the inactivity timeout of the session (by last_modified) or whether this is the timeout from when the session was created (as stated in the php.ini file).
Has anyone got any ideas regarding this? As i've completely hit a brick wall and as last resorts the only option seems to be to re-write the authentication side of things to use cookies (has been recommended a few times on other forums), which i've tried to stay away from due to security.
Cheers for any help on this though

This is after logging in (no sessions set/displayed), redirect (php header location etc) to application main page (session variables are set correctly/displayed), leaving the system idle for 25/30mins, click a random link, software thinks it's not logged in redirects to login page (no sessions set).
Is there a way to switch the session garbage collection off? Would setting 'session.gc_probability' to 0 switch it off?