djfox Posted January 10, 2008 Share Posted January 10, 2008 This is what I currently have (I -think- this is where the session time is set for my site, someone else had made the session thing and I find no other place of numbers in regards to sessions): function RemoveSession() { $_SESSION = array(); if (isset($_COOKIE[session_name()])) { @setcookie(session_name(), '', time()-4200000000, '/'); } } If I want the session to last an entire day (24 hours), how would I adjust that? Quote Link to comment https://forums.phpfreaks.com/topic/85282-solved-adjust-time-for-session-to-last/ Share on other sites More sharing options...
revraz Posted January 10, 2008 Share Posted January 10, 2008 You mean COOKIE to last that long I assume setcookie(session_name(), '', time()+(60*60*24), '/'); Quote Link to comment https://forums.phpfreaks.com/topic/85282-solved-adjust-time-for-session-to-last/#findComment-435124 Share on other sites More sharing options...
djfox Posted January 10, 2008 Author Share Posted January 10, 2008 Just to be sure I read those correctly (in case I decide to change my mind later), to 60*60*24 says for seconds*minutes*hours, am I correct? Quote Link to comment https://forums.phpfreaks.com/topic/85282-solved-adjust-time-for-session-to-last/#findComment-435126 Share on other sites More sharing options...
revraz Posted January 10, 2008 Share Posted January 10, 2008 Time is based on seconds. So just multiply till you get what you need. Quote Link to comment https://forums.phpfreaks.com/topic/85282-solved-adjust-time-for-session-to-last/#findComment-435127 Share on other sites More sharing options...
djfox Posted January 10, 2008 Author Share Posted January 10, 2008 Ah ok. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/85282-solved-adjust-time-for-session-to-last/#findComment-435129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.