LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2004, 02:54 PM   #1
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
PHP session.gc_maxlifetime


hi,
as u may know session.gc_maxlifetime is a variable determined in php.ini that sets the interval for the garbage collection to remove unused stuff after a given time.
Does it remove all session variables older than this amount of time or does it remove only those variables and directories that have not been touched for the time? If u know for sure plz gimme an answer or a hint where to find reliable info.
thanks a lot
j.
 
Old 11-07-2004, 01:45 PM   #2
mgatny
Member
 
Registered: Mar 2004
Posts: 41

Rep: Reputation: 15
By default, PHP stores sesssion information on the filesystem. Each session has one file containing serialized session variables.

When the GC runs, it loops through the entire directory where the session files reside. For each session file, the filesystem mtime is subtracted from the current time, and if this amount of time is greater than session.gc_maxlifetime, the session file is deleted.

In other words, accessing an 'expired' (i.e. according to the lifetime you specified) session stored in a particular directory will cause other 'expired' session files in that directory to be cleaned up as well. Therefore, be careful when modifying the session.gc_maxlifetime. You may want to give your script its own session.save_path so that you do not unintentionally clobber other sessions.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
PHP session is not destroyed !! prabhatsoni Programming 8 07-21-2005 10:15 AM
php session richard22 Programming 2 10-26-2004 05:50 AM
PHP Session ID Security pnh73 Linux - Security 11 11-13-2003 01:51 PM
PHP Session -- Url contains ?<NAME>=<ID> tomgun6 Programming 0 03-02-2003 11:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration