@NogDogDec 09.2005 — #I haven't tested this out, but based on my understanding, this should do the trick: [code=php] session_set_cookie_params(8*60*60); session_save_path('/some/path/unique/for/this/set/of/scripts'); ini_set('session.gc_maxlifetime', '28800'); session_start(); # rest of script... [/code] Note: make sure the directory specified in session_save_path() is writeable by the PHP user.
@phantom007Oct 09.2008 — #I haven't tested this out, but based on my understanding, this should do the trick: [code=php] session_set_cookie_params(8*60*60); session_save_path('/some/path/unique/for/this/set/of/scripts'); ini_set('session.gc_maxlifetime', '28800'); session_start(); # rest of script... [/code] Note: make sure the directory specified in session_save_path() is writeable by the PHP user.[/QUOTE]
Hi
Question: Do we have to put the code [b]ini_set('session.gc_maxlifetime', '28800'); [/b]in all our php pages or just on the login page will do?
@NogDogOct 09.2008 — #It would need to be in each file that uses sessions if you do it that way. Of course, it would be easier to put (and the cookie setting, too), into your PHP config file (php.ini) or a local .htaccess file if allowed.
@huyhoang08Nov 03.2010 — #i have some codes for uploading using php & party third that is flash. i try to upload with max size of 2mb to summerhost, but not work. pls help me!
i get suggest that config via .htaccess file something like this: --------------------------------------
is this code really required, if yes please tell me why we need to use this code and how do we build the path.
Thanks
Vijay[/QUOTE]
You only need it if other sites or pages within your site might be sharing the same PHP session data directory, in order to keep those other sites' or pages' session data clean-up times from impacting your times.