noamkrief Posted January 29, 2009 Share Posted January 29, 2009 Hi everyone. I have this big issue that i'm thinking might be related to my php.ini file. I have a clean install of xampp on win32. humm - maybe it's my code I have a secured site I'm using for time clocks for our employees but it keeps kicking them out. When they sign in after authentication of the db, I do: session_start(); $_SESSION['user_id'] = $USER_ID_FROM_DB; i'm also registring some security tokens in sessions etc... At the top of every secure page, I have a require('./security.php'); security.php has something like: $sql = mysql_query("select * from employee where PER_ID = $_SESSION[user_id]"); if mysql query failes - it kicks them back to login page. On the login page I'm doing debugging. I have it echo $_SESSSION['user_id'] which shows empty after the sessions get magically wiped out! What could be the cause? Why are the sessions not sticking for very long? The longest I have been able to stay on is about 1 hour. It has nothing to do with browser inactivity or anything like that because even when I'm using it, I all the sudden get kicked off. Thank you Link to comment https://forums.phpfreaks.com/topic/142917-im-losing-session-variables-random-usually-after-about-12-hour/ Share on other sites More sharing options...
genericnumber1 Posted January 29, 2009 Share Posted January 29, 2009 What is your session.gc_maxlifetime setting in your php.ini file? An odder question: what file system is your windows installation using? NTFS? FAT? Link to comment https://forums.phpfreaks.com/topic/142917-im-losing-session-variables-random-usually-after-about-12-hour/#findComment-749320 Share on other sites More sharing options...
noamkrief Posted January 30, 2009 Author Share Posted January 30, 2009 sorry it took me a while to reply - i wasn't getting notification email when there was a reply to my post. session.gc_maxlifetime = 1440 I'm using NTFS Thanks alot at helping me troubleshoot this Noam Link to comment https://forums.phpfreaks.com/topic/142917-im-losing-session-variables-random-usually-after-about-12-hour/#findComment-750446 Share on other sites More sharing options...
dropfaith Posted January 30, 2009 Share Posted January 30, 2009 if im not mistaken its in seconds and 1440 is about 24 minutes make it a higher number Link to comment https://forums.phpfreaks.com/topic/142917-im-losing-session-variables-random-usually-after-about-12-hour/#findComment-750448 Share on other sites More sharing options...
noamkrief Posted January 30, 2009 Author Share Posted January 30, 2009 That solved it! Thank you so much!!!!! Noam Link to comment https://forums.phpfreaks.com/topic/142917-im-losing-session-variables-random-usually-after-about-12-hour/#findComment-750752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.