By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Does setting session.gc_maxlifetime affect all sessions on server?

P: n/a
Before I extend the users session timeout, with
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.

Thanks!

Jan 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 17 Jan 2007 08:24:01 -0800, ro***********@gmail.com wrote:
>Before I extend the users session timeout, with
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?"
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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.