Re: PHP Sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Wagner wrote:
i recently started using PHP's sessions.  i am finding that the sessions
seem to "expire" after 20 or 30 minutes -- or, at least the variables
which i set, within $_SESSION, are getting cleared after this relatively
short amount of time.

before calling session_start(), i do a few initializations:

ini_set('session.use_cookies', 1);
ini_set('session.use_trans_sid', 0);
ini_set('session.save_handler', 'files');
ini_set('session.serialize_handler', 'php');
ini_set('session.name', 'session-id');

i am not setting the 'session.cache_expire' INI variable, and even did a
check to make sure it was not being modified, and i found that it
contains the default value of 180 (minutes).

furthermore, the *cookie* is not expiring.  i've also checked
'session.cookie_lifetime', and it is 0 (zero, for "until browser is
closed").  i've also checked the browser's cookie list, and the cookie
is still around at the time that i lose my session variables.

does anyone have any ideas as to why i may be losing my session
variables so early?

Check session.gc_lifetime or similar. That is the garbage collection routine that goes through and deletes any session data files (in /tmp or wherever your setup puts them) that are older than that config setting value.

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux