Pi_Mastuh Posted February 17, 2007 Share Posted February 17, 2007 When the user logs in on my site it uses session_start(); session_register('preuserName'); session_register('preuserID'); $session=session_id(); mysql_query("UPDATE chibifriends SET userLastLogin = '$today' WHERE preuserID = '$preuserID'"); to log them in. How would I make the sessions not expire and when they go to the site (index.php) re-direct to another page if they're logged in? Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 session_start(); on all pages better yet put your session stuff in a session.php and require it in all pages.. Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted February 18, 2007 Author Share Posted February 18, 2007 I have the sessions carried to each page, but they end when the user closes the browser or leaves the site. I want it to keep them logged in until they log out. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 18, 2007 Share Posted February 18, 2007 you would need cookies for that then. sessions end when the browser is closed. Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 18, 2007 Share Posted February 18, 2007 sessions never end for me and even if i close browser I got like 5000 of them in my php/sessions folder not unless you unregister the session it wont go again i think yes u do need cookies for some remembering support Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted February 18, 2007 Author Share Posted February 18, 2007 I tried using cookies but they wouldn't delete when the user logged out. It had trapped users in. Quote Link to comment 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.