.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

session modes

Posted By: sankar     Posted Date: September 02, 2008    Points:2   Category :ASP.Net
session has 3 modes.

1) inproc

2) stateserver

3) sql state


any one plz tell me in each mode where can the session data will store,and how we check/see the data in each mode...


examples helps me greate.

Responses
Author: Amit Mehra             
Posted Date: September 02, 2008     Points: 5   

Yes session has 3 modes

1) InProc - In-process mode session state values are stored in memory on the local Web server

2) StateServer - StateServer mode stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool.

3)Sql Server- SQLServer mode stores session state in a SQL Server database. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm

You can see the value like this

string sessionID = Session.SessionID;

Regards
Amit

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: sankar             
Posted Date: September 02, 2008     Points: 5   

Thank you very much Amit.


so through sessionId how can i know whether it is inproc or state server.

one more thing is how can i track the values in state srever.

Author: Amit Mehra             
Posted Date: September 02, 2008     Points: 5   

By default the session is stored in InProc unless it is defined in web.config file like this


<sessionstate
mode="stateserver"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
server="127.0.0.1"
port="42424"
/>


I recommand you to follow this link

http://msdn.microsoft.com/en-us/library/ms972429.aspx

Amit

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: TotalDotNet             
Posted Date: August 16, 2010     Points: 5   

Hi

In case of InProc the Session data stored in worker process of same server (aspnet_wp)

In case of State Server the session data stored in separate State Server process (aspnet_state)

In case of SQL Server session data stored in SQL Server Database.

Note in all these three cases the session id stored in client machine either in cookies or in url.

Regards
http://www.TotalDotNet.Com



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend