Re: cookie saving problem
| From: | Marek Kilimajer | Date: | Tue, 21 Sep 2004 00:24:58 +0000 |
| Subject: | Re: cookie saving problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197368@lists.php.net to get a copy of this message | ||
Jason FB wrote:
PHP GENERAL LIST: I am trying to get the session cookie to stay active for 10 years I have at the top of EVERY page on my website an include statement which includes a file which contains only this code: <? # THIS FILE JUST SETS THE SESSION AND INITIALIZES IT TO 10 YEARS session_set_cookie_params(60*60*24*365*10); session_start(); ?> If I quit my browser and re-launch, it seems to remember my session variables. [Which was NOT the case when I had these two lines of code reversed -- the sesssion_start() before the session_set_cookie_params() ] However, if I return to the site the following day, it seems to forget my session variables. This has happened 2 days in a row, so I'm a little stumped. Can anyone see what I'm doing wrong?Garbage colector deleted the session file. You need to change session.gc_maxlifetime setting and likely also session.save_path to your own diretory. Hope you have plenty of disk space available.