Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many kilobytes max. per PHP session? 3

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR

I read that's it's a maximum of 4kb for a cookie.
Is it the same for PHP sessions?

Thanks ;)
 
i am not aware of any php imposed size limit on sessions.

you may be constrained by the storage mechanism: your database tables (if using db based sessions) or your file system for standard session management.
 
Although there is a limit on the size of an HTTP cookie, PHP's session-handling mechanism stores the actual session variables and their respective values on the server and uses the cookie only to store an index to the session store. So no matter how much you store in a session, the same amount is stored in the cookie placed on the client.

I have read of people running afoul of limits on the amount of data that can be stored in a session, but not recently. I imagine (but do not know for sure) that there was a limit build into the serialization routines, and that those limits, if they still exist, are now pretty large.



Want the best answers? Ask the best questions! TANSTAAFL!
 
I read in a book some time ago that cookies were limited to 20 per domain (by "the" browser??) and 4kb in size. I have no idea if this is true anymore or not, I am trying to look into it - but returned nothing as of yet.
 
Ignore the previous post, it would appear I misread the question somewhat ;)

I don't believe there's a limit on session data, as it's stored server side and I can see nothing on changing the size limit in the PHP manual or in my PHP.INI - hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top