Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
January 17, 2007, 4:24 pm
rate this thread
ini_set("session.gc_maxlifetime",86400*2); // buy the user 48 hours to
make a decision, I wanted to know if this idea is going to affect all
users/session on the server or just the "current user session?" There
isn't a user/pass combo to get in my site. Once the cart is started,
this script is invoked. When this site is released to the client, I
don't want him coming back to me one day to say his site is down
because of an indefinite memory full thing.
Re: Does setting session.gc_maxlifetime affect all sessions on server?
That will affect the session garbage collection run at the end of the current
request. However, it won't affect other session garbage collection runs done on
the back of requests for pages that don't have that ini_set call - this isn't
something stored within the session files.
So, if there are other sites on the same server, you'd have to also modify the
session.save_path for your sessions where you want a longer gc_maxlifetime,
else they'll just be purged by the settings that apply to the other sites and
you just end up (on average) the shortest value set. If you put the sessions
files elsewhere then they'll be isolated from this.
Andy Hassall :: email@example.com :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool