I am learning something about sessions recently, and so far I understand that sessions and cookies are used on sever side and client side respectively to track the states of a request. And a few threads or instances will be created on server to handle different requests, suppose there are 2 requests A and B from a same client, the session for this client was set within request A by thread 1, request B is handled by another thread thread 2, and obviously the request B can get the info from the session. This means the “sessions” is not stored on a certain thread in this case not stored on thread 1, because request B can also get info stored in “sessions”. So based on the scenario above, here comes my questions:
- Where really are the sessions stored ? I’m assuming somewhere that can be accessed by all threads or instances.
- What’s the relationship between the “session inventory” and the Application Pool (I am referring to IIS and .Net here)
- If I shut down the server and start it again, are all sessions gone ? What techniques are needed if we want to persist the sessions ?