[PHP] cookie saving problem
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? Also, is there something special that has to be done for Netscape to make the cookie stay set for that long? (I saw some mention of a Netscape issue in the manual pages, which is what makes me ask). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie saving problem
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie saving problem
On Tuesday 21 September 2004 07:33, Jason FB wrote: I am trying to get the session cookie to stay active for 10 years Session cookies as its name suggests lasts for the duration of the session, meaning your browser does not store them anywhere permanent and are lost when browser is closed. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A fool must now and then be right by chance. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php