Jump to content

[SOLVED] Maximum amount of PHP sessions


woolyg

Recommended Posts

Hi all,

 

is there a maximum allowed number of session variables PHP / a PHP server can handle? This is more of a reference question for my own records - say if I had 1,000 users logged in and each had loads of session variables assigned to their session, is there any point where they might start failing?

 

Woolyg.

Link to comment
Share on other sites

This is how PHP handles sessions (by default):

 

A)  Session ID is sent from the cookie

B)  PHP finds a file with the session ID as its name in the session tmp directory.

C)  PHP loads the contents of said file

D)  Contents are deserialized into $_SESSION

 

So, really that would be a file system thing in a sense....  Once php has the file handle to get the data from the file, it doesn't know if there're 1000000 other files in that folder.  It's just getting the file system to go, "OK here's file 23918zadsfa023.tmp."

 

I would think you should be fine with sessions.....

 

If the session array was extremely huge, the serialized data might be massive, causing the load/parsing time to cause a very slight delay, but for that to be noticable, it would be massive.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.