I dont think there is any limit to the number of session variables.
However consider using less session variables (combine variables required into an object and assign the object to the session)
Obviously the bigger your session variable goes the more memory it will take...(One session per user...and also considering the non-expired sessions existing in the server)
IIS (unless you're on a server addition of windows) has a limit to connections.
I don't remember the exact specifics but it's something like:
Two simultanious connections from one clientbroswer and I think like 20 different clientbrowsers at one time.
So as to the number of sessions you can have, if the above limitations don't have an effect, it will be based on the processing power/time your cpu can give as well as the amount of available ram for your server.
Hi Plater,
Does creating 2 session variables for each client count as one or 2 seperate sessions? (logically should be under the same session)
So is there any restriction to the size of the session variable (ofcourse someone might come in and start storing images and files in the session sooner or later :P)
When you say two session varriables do you mean like:
Session.Add("Va l1","1234");
Session.Add("Va l2","abcd");
??
Storing more objects in a users session will require more memory then just storing one. Think of it as a database system (which it is)
With a basic of two tables:
One table lists your "users" (if 3 people are on your system, there are 3 entries in the table)
The other table stores all the objects, and has a column that points to "which user it belongs too" (one of the entries in the user table)
So TWO users each with ONE item in their session, would theoretically take up more memory then ONE user with TWO items in their session.
But generally a lot of data isn't really kept in the session, unless you have like a hopping cart or something.
Comment