woolyg Posted December 19, 2007 Share Posted December 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
corbin Posted December 19, 2007 Share Posted December 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
woolyg Posted December 19, 2007 Author Share Posted December 19, 2007 Cool, thanks Corbin! That clears things up in my mind. Cheers, Woolyg 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.