ASP.NET Session ?

  • Thread starter Thread starter Kevin Jackson
  • Start date Start date
K

Kevin Jackson

Does accessing a session variable multiple times during the processing of a
page incur a hop each time it is accessed in State Server and SQL Server
modes? Or does the roundtrip occur just once and then the variable used
from a session cache for the rest of the request?

Is the session written out at the end of the request or when a session is
written to?
 
the session object dictionary is loaded at OnBeginRequest, and saved at
OnEndRequest. In between you just talk to the dictionary. this can lead to
some strange behavior

create session like:
Session["myobj"] = myObject;
Session["myobj2"] = myObject;

until session save, Session["myobj"] and Session["myobj2"] refer to the
same object, so changing value in one, changes it in both. but on the next
page request, they refer to different objects (because they each get
serialized).


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top