Session vars in /tmp/sess_*: how long? how removed?

From: Date: Wed, 15 Mar 2000 18:18:59 +0000
Subject: Session vars in /tmp/sess_*: how long? how removed?
Groups: php.version4 
Request: Send a blank email to php-version4+get-12173@lists.php.net to get a copy of this message
I'm using PHP4b3 on Solaris-Sparc to track sessions, using the default server filesystem storage where session-variable state is stored in files like: /tmp/sess_a1239cc794573b9831138b4899b182f6 I am finding that after registering some session variables successfully then letting the page hang out over night (or some other long time) that the session file goes away and that the server "forgets" that the session existed. This is causing my code to think that the user has never authenticated, or worse -- since the session variables disappear -- that the session variables are all zero. How long do these session variables last? I'm using PHP as an Apache module; do they last only as long as the particular Apache spawned child which performed the session_register() and create the /tmp/sess_* file? Something is obviously expiring my /tmp/sess_* files, otherwise I'd have a huge number of files: one for every user who's ever visited the site -- but the number of such files is in the tens or hundreds at any one time, appropriate to the active ("authenticated") session users. What's expiring the files and how does it decide to remove them? Are there work arounds to this, such as using the session_set_save_handler() functions and friends? If have to use this to get reliable session variable storage, of what use are the /tmp/sess_* files? Thanks.

« previous php.version4 (#12173) next »