robcrozier Posted March 4, 2009 Share Posted March 4, 2009 Hi. I wonder if anyone can advise me on this.... Basically, i've got a 'User' class which contains all the relevant methods to log a user in, validate their login status etc.... However, i'm having a few issues with some people (on different machines) being logged out after only 5mins even though the session settings are set to stay alive for 20 mins. What i want to do is create a login script that does not rely solely on sessions, but also a users last activity in the database. My current user class uses a 'username' session to collect all data about a user however and if this is not present, the user data cannot be collected and thus the user cannot remain logged in!? Can anyone suggest how i would go about this? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/147896-solved-oophp-user-authentication/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 4, 2009 Share Posted March 4, 2009 Are you on a shared web server and is the session.save_path setting using the default shared folder? If so, one of the other scripts running on the server has probably set a shorter session.gc_maxlifetime. The solution is to set the session.save_path to be to a private folder within your account's folder tree so that your session.gc_maxlifetime setting only affects your session data files. Quote Link to comment https://forums.phpfreaks.com/topic/147896-solved-oophp-user-authentication/#findComment-776260 Share on other sites More sharing options...
robcrozier Posted March 4, 2009 Author Share Posted March 4, 2009 Mate, you're a star! That was the issue! Thanks a million Quote Link to comment https://forums.phpfreaks.com/topic/147896-solved-oophp-user-authentication/#findComment-776280 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.