> I'm setting a session with
> session_set_cookie_params (time()+6480000);
> so the cookie should last 70 days+ but the data wasn't
> returned.
> 
> from looking in the manual i see that session_cache_expire is used to
set
> or print the current value of the expire. Its set in php.ini by
default to
> 180 minutes.
> 
> So it seems that the garbage collector will clean up the session file
> after 180 mins or 10800 seconds which is less then i was expecting
after
> setting the cookie life.
> 
> do i need to set
> 
> session_set_cookie_params (time()+6480000);
> session_cache_expire (6480000);
> 
> for the data to still be available if the user returns during the
cookies
> life and is this on a per session basis.

Well, first of all, session cookies are deleted when the user closes
their browser. So unless the user is leaving the browser open for 70
days, this setting won't matter. 

session.gc_lifetime is the setting that controls the garbage cleanup. If
the session is inactive past that time limit, then the session file will
be deleted. 

Sessions aren't meant to be a "remember me" function. You'll need to use
regular cookies that persist after the browser is closed for that. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

Reply via email to