Know what you are putting in Session

Session state is one of the important thing that differentiates thestatic html pages with server rendered pages. Following checklist can be maintained while deciding to put somethingin

DevPro Staff

March 27, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today

Session state is one of the important thing that differentiates the static html pages with server rendered pages. Following checklist can be maintained while deciding to put something in session

  1. Understand that Session state should only be used to store session related data, unlike caching where we can store it until the application is restarted.

  2. Always keep the information that is relavent to that session of the user like user login credentials, authorization list and application related information relavent and frequently used during the lifetime of that session.

  3. Use one huge string to store multiple smaller values using a delimiter, than storing them under different names.

  4. Avoid putting complete business objects in session as it will hog the system resources slowing down the server. If something has to be persisted through out the application lifetime, cache them.

  5. Use options like InProcess session management, StateServer or SQL server effectively based on the size of applications.

Make your application robust and fast by handling sessions better.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like