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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to