ASP.net session state service information [duplica

2019-07-29 20:33发布

问题:

Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc. Have looked on internet but cant find in depth information or an article dedicated to the subject. Thanks

回答1:

Programmatically, session state is nothing more than memory in the shape of a dictionary or hash table, e.g. key-value pairs, which can be set and read for the duration of a user's session.

Check following links for more details:

  • "ASP.NET Session State" on MSDN
  • "Session State Overview" on MSDN


回答2:

For SQL Server State Management remember that you don't call Session["Key"] in loops. (Try to avoid that) Because everytime it accesses the session then a roundtrip to sqlserver is made.