What are the different modes of storing an ASP.NET session?

InProc (the session state is stored in the memory space of the Aspnet_wp.exe process but the session information is lost when IIS reboots), StateServer (the Session state is serialized and stored in a separate process call Viewstate is an object in .NET that automatically persists control setting values across the multiple requests for the same page and it is internally maintained as a hidden field on the web page though its hashed for security reasons.

What are the ways to manage state in Asp.Net application?

Ways to manage state in Asp.Net are:

  • Using Session and Application objects to cache information.
  • Using Memory and Disk Cookies to preserve information.
  • Using hidden input fields or the URL -embedded information to pass information from one page to another.
  • Using the ViewState property of the page to set and retrieve information stored in a StateBag object.
  • Using SQL Server to store state information.

What is the difference between Application_start and Session_start?

Application_start gets fired when an application receive the very first request.
Session_start gets fired for each of the user session.

What is a session in ASP.NET? Different ways to maintain session?

Session – The session object is used to store the data specific to a user for the entire length of a user’s visit to a website. Below is a code that shows usage of the session object in ASP.NET …

//InitialPage.aspx stores the user’s credentials in Session state
Session(“UserName”) = txtUserName.Text;
Server.Transfer(“DestinationPage.aspx”);

//DestinationPage.aspx gets the user’s name from Session state
String sString = Session(“UserName”).ToString();

What file do you use to handle Session and Application events?

The global.asax file handles Session and Application events.

What is a Session and Application object?

Session object store information between HTTP requests for a particular user, while application object are global across users.

What is difference between session and application?

session is a object that store information between http request for a paticular user. ->But application object are global for each user