phprocket Posted June 1, 2008 Share Posted June 1, 2008 What is the difference between these ? ini_set('session.name','PUMMS'); ini_set('session.cookie_lifetime',99992592000); ini_set('session.gc_maxlifetime',99992592001); session_name('PUMMS'); session_set_cookie_params(99992592000,'/',$pumms_domain_cookie); Should one method be used over the other ? I have seen other people use both by testing for a function ? I could use some help understanding this. The end goal is to change the session name and setup the session cookie not to expire when browser is closed. My script will check the session value and determine to let the user in or not based by a configurable time set in the database. Resources, http://us2.php.net/manual/en/function.session-set-cookie-params.php http://us2.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime Thanks, David Link to comment https://forums.phpfreaks.com/topic/108222-whats-the-difference-setting-sessions/ Share on other sites More sharing options...
paulman888888 Posted June 1, 2008 Share Posted June 1, 2008 one sets the session the other one uses the sessions Link to comment https://forums.phpfreaks.com/topic/108222-whats-the-difference-setting-sessions/#findComment-554735 Share on other sites More sharing options...
phprocket Posted June 1, 2008 Author Share Posted June 1, 2008 one sets the session the other one uses the sessions I think they both set the Custom SESSION cookie, I have tried this both ways.. I am thinking ini_set() can be turned off some how, but I am not relly sure on that. Link to comment https://forums.phpfreaks.com/topic/108222-whats-the-difference-setting-sessions/#findComment-554740 Share on other sites More sharing options...
PFMaBiSmAd Posted June 1, 2008 Share Posted June 1, 2008 session_set_cookie_params() is simply a built in function that sets the values instead of using individual ini_set() statements. There is no functional difference. Any value that could be prevented from being changed would be prevented using either method. Link to comment https://forums.phpfreaks.com/topic/108222-whats-the-difference-setting-sessions/#findComment-554805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.