Catfish Posted April 2, 2008 Share Posted April 2, 2008 Hi, I'm building some scripts that I designed with multi-user environment in mind from the start. In the last week I finally added my code to manage the user login system. I'm using session() functions to do this. I pretty much just call session_register() and register the username into $_SESSION after the username and password authenticates correctly. From then on, any page that loads uses an include call to load my "sessionCheck.php" file which just calls session_start(); and checks if 'userLogin' is registered in the session. If it's not, it returns to the user login page and if it is registered then it will continue loading the desired page. Since adding these session functions to my code, page load time is down to maybe 1-1.5 seconds compared to almost instant loading before hand. Are there any reasons why it slows down so much or is that just the nature of sessions? Are there any other alternative methods I can use for a user-login/logout management system? If so, where can I find some documentation on this? Any help or comments are appreciated. Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/ Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 These functions shouldn't slow down performance. You might want to read up on session_register though, it has long been depricated and is no longer needed. Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/#findComment-507368 Share on other sites More sharing options...
Catfish Posted April 2, 2008 Author Share Posted April 2, 2008 So i should just use $_SESSION['userLogin'] = "..."; instead of session_register();? Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/#findComment-507396 Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Yup. Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/#findComment-507397 Share on other sites More sharing options...
Catfish Posted April 2, 2008 Author Share Posted April 2, 2008 Ok, will change that later. Are there any other methods used to manage a user login environment and private pages under PHP? Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/#findComment-507409 Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Are there any other methods used to manage a user login environment and private pages under PHP? Not really, thats one main objective of sessions. Link to comment https://forums.phpfreaks.com/topic/99170-session-functions-slow-scripts-down-noticably/#findComment-507418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.