Depends on which mode you are using:
- InProc Mode- objects stored in session state are actually live objects, and so you can store whatever object you have created.
- State Server or SQL Server mode, objects in the session state will be serialized and deserialized when a request is processed. So make sure your objects are serializable and their classes must be marked as so. If not, the session state will not be saved successfully. In v1, there is a bug which makes the problem happen unnoticed in SQLServer mode and will make your request hang. The hanging problem is fixed in v1.1. The fix for KB 324479: ASP.NET SQL Server Session State Impersonation Is Lost Under Load also contains the fix for this problem. The problem will be fixed in v1 SP3 too.
For more info: BUG: Session Data Is Not Saved in Out-of-Process Session State
Share with