Connecting Tech Pros Worldwide Help | Site Map

Does setting session.gc_maxlifetime affect all sessions on server?

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 17th, 2007, 03:35 PM
robbiesmith79@gmail.com
Guest
 
Posts: n/a
Default Does setting session.gc_maxlifetime affect all sessions on server?

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!


  #2  
Old January 17th, 2007, 05:55 PM
Andy Hassall
Guest
 
Posts: n/a
Default Re: Does setting session.gc_maxlifetime affect all sessions on server?

On 17 Jan 2007 08:24:01 -0800, robbiesmith79@gmail.com wrote:
Quote:
>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 :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.