Three type of session state mode available in Asp.Net--- 1) In Proc:- In this mode session kept as line objects in web server(aspnet_wp.exe). It used cookiless configuration in web.config to munge the session ID on to the URL. 2) State Server:- In this mode session is serialized and stored in the memory in a separate process (aspnet_state.exe). It can be run on another mechine. 3) SQL Server:- In this mode session data is stored in the SQL Server. mainly this mode is used in such a scenario when the session data is so important. It can be stored any where in the Clustered Server mode. So, if a SQL Server is restart the it can be retrieved. Performance Issue:- In Proc:- It works fast, But if more session data, more memory consume on web server. State Server:- when storing data of basic type (string,int etc), it is 15% slower than In Proc. However cost of serialization/deserialization can affact performence, But it can store lots of objects. SQL Server:- It is 25% slower than In Proc. Rules:- In Proc:- It supports session_end event. But it can not work in the web garden mode, because in the web garden mode multiple aspnet_wp.exe will be running on the same mechine. State Server:-In a web form you must have the same as in your web server. Object must be serializable.To access the state data in different web server the application path of the web sites in the IIS metabase should be identical. SQL Server:-If you specify integrated security in the connection string (eg. "Trusted-Connection=true" or "Integrated security=true") or turn on Impersonation in asp.net it would not be work.
1. In Proc mode 2. State server mode 3. Sqlserver mode