I haven't tested this out, but based on my understanding, this should do the trick:
PHP Code:
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...
Note: make sure the directory specified in session_save_path() is writeable by the PHP user.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
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.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
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:
--------------------------------------
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_execution_time 300
--------------------------------------
But still not work in server
Pls, suggest me.
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
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.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks