I'm working on a site where I am using session variables for the login. I am storing a php object/class in this session. this works fine and I'm storing user variables in the object/class to cut down on database usage. So the user variables are grabbed from the database when the user signs in and stays inside the session until the user logs out or the session expires; so instead of running to the database every time the user needs specific data it just grabs it from the session object. I need to know how much data you can safely store inside a session until something dumb starts happening. If anyone can tell me something important about using this method please do. thanks Clinton
You can almost store more than one cookie or session variable. So you really can store as much stuff as you'd like.
Thanks If I can store as much as I'd like than thats awesome, because the more I store during a session the less I have to grab from the database every time a user changes a page in the user panel. thanks for the reply
you may be saving on mysql's queries but you are using up your webserver's resources, the webserver maintains these sessions so i dont think its any efficient. just my 2 cents
Number and size limits of a cookie in Internet Explorer http://support.microsoft.com/kb/306070 Microsoft Internet Explorer complies with the following RFC 2109 recommended minimum limitations: • at least 300 cookies • at least 4096 bytes per cookie (as measured by the size of the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie header) • at least 20 cookies per unique host or domain name
thanks everyone for the help I guess I've changed my plans around. I'm only storing info for the most reused data such a user name, id, email, user rating, session expiration, last logged in, date joined/activated and maybe some account options. I guess if I keep my sql queries well optimized I can keep things running fast. thanks again