Jump to content

session functions slow scripts down noticably


Catfish

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.