Re: Sessions

From: Date: Sat, 11 Oct 2003 09:40:24 +0000
Subject: Re: Sessions
Groups: php.general 
Request: Send a blank email to php-general+get-165842@lists.php.net to get a copy of this message
The "Session" documentation IS difficult to understand. I wrestled with it for some time (and still am). There's just no clear "cookie_lifetime" variable! All of Lowell Allen's instructions are the same that I've discovered, save that I set the 'session.gc_maxlifetime' to a large number - I was having trouble with the system forgetting me while I was testing. Your typical user might not sit around for an hour between actions, but I did, and while the session might have still been registered it lost the $USERID variable. You can set the session settings in PHP code using 'ini_set' or 'ini_alter' (see the documentation), or (and I like this better) in your .htaccess file - assuming you're using Apache: php_flag session.use_trans_sid off php_flag session.cookie_lifetime 0 php_flag session.gc_maxlifetime 3600 ... as appropriate, of course. Unfortunately this approach isn't very well documented (hmmm, maybe _I_ should...) - I think I stumbled across it a couple years ago. I set the 'use_trans_sid' to off to see why the SESSIONID kept showing up in the URL at odd times. Test using phpinfo() to see if the Local settings change from the global.

« previous php.general (#165842) next »