the objects are shared across the context (request/response). between request/response is just string dictionaries. that's the nature of web at some level the objects are (de)serialized to text (or byte[] arrays).
here is another way to think of it. treat eaach request/response pair as an atomic unit of work. it starts with receiving the request. which is really a glorified dictionary of string keys with string values. you can do whatever you want within this unit of work. it commonly envolves hydrating values from strings into an object. database calls, logic, changes to the objects from the database, saving changes to the database, and finally sending a response back to the client. the response is text or byte[].
between sending the response and getting the next request you have:
application state
cache
session
there is very little you need to put into these containers, each has it's own behavior which you need to consider when storing information in it.
1. application state is shared by everyone. and is alive for the duration from the very 1st response to ~20 minutes after the very last response.
2. cache is shared by everyone, but will purge itself of data when thresholds are met (the thresholds are configurable)
3. session is specific to the user for the duration of the current set of requests. by default it expires after 20 minutes of no activity, or when Session.Logout is called. I think that's the name of it.
when you begin to store modified values in these containers the unit of work (current context) can get nasty side effects and bugs become more difficult to track down.
jbenson, yes he could stuff this into session and get the object, but that is the hammer and nail analogy. "any time i need an object I'll stuff it into session".
Jason Meckley
Programmer
Specialty Bakers, Inc.
faq855-7190