sessionmanagenent in

Posted by Shanky11 under ASP.NET on 11/27/2012 | Points: 10 | Views : 701 | Status : [Member] | Replies : 2
session state=inprocess,state server ,difference between it


Posted by: Saratvaddilli on: 11/27/2012 [Member] [MVP] Bronze | Points: 25

the major difference between them is where we store the session data

<sessionState mode="InProc" cookieless="false" timeout="20" />

InProc (the default) indicates that the session state is stored in memory by ASP.NET and that cookies will not be used to pass the session ID. Instead, the session ID is inserted into the query string for a page's URL. For example, using InProc mode, after a session is established, a call to a hypothetical ASP.NET page
storing session data in a separate in-memory cache controlled by a Windows service running on a separate machine. The state service, called the ASP.NET State Service (aspnet_state.exe), is configured by the stateConnectionString attribute in the Web.config file. It specifies the service's server and the port it monitors:

<sessionState mode="StateServer" stateConnectionString="tcpip=myserver:42424" cookieless="false" timeout="20" />

once go through this link for complete info

Thanks and Regards
Show difficulties that how difficult you are

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 11/27/2012 [Member] [MVP] Gold | Points: 25

Well the state server is a little slower than in proc. The benefit you will get out of it is that if you need to recycle the app pool, then the state of the application (user sessions etc.) will be unaffected. If you plan on using a state server in the future, I would start using it now. With in process, objects are stored in memory as is, but with the state server they are serialized. This can be a big deal if you plan on making the switch later as you'll have to check that everything you store in state is serializable. If you start out with that restraint, you know up front (while you're actively working on that module) what is going to work and what isn't.

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response