r-it Posted July 31, 2008 Share Posted July 31, 2008 Helo there, I wonder if anyone can help me, i have this code that sets a session to be 60 minutes: $_SESSION['goobly'] = $user; ini_set(’session.gc_maxlifetime’, 30*60); but then the person i was developing this for left their pc for 30 minutes and the session expired, so i set it to: $_SESSION['goobly'] = $user; ini_set('session.gc_maxlifetime', 1200*600); and the same thing is happening, am I doing something wrong?? Link to comment https://forums.phpfreaks.com/topic/117537-manually-setting-session-timeout/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 31, 2008 Share Posted July 31, 2008 To start with, you must set session.gc_maxlifetime before session_start() (like it states in the php manual) and your posted code implies you are attempting to do it after. Also, the shortest session.gc_maxlifetime of all the scripts running on the same server wins. If you are on a shared server, you must set the session.save_path (again before every session_start()) to point to a private folder within your account's space so that your session.gc_maxlifetime setting will only affect your session data files. Link to comment https://forums.phpfreaks.com/topic/117537-manually-setting-session-timeout/#findComment-604564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.