Javatpoint Logo
Javatpoint Logo

ASP.NET Session

In ASP.NET session is a state that is used to store and retrieve values of a user.

It helps to identify requests from the same browser during a time period (session). It is used to store value for the particular time session. By default, ASP.NET session state is enabled for all ASP.NET applications.

Each created session is stored in SessionStateItemCollection object. We can get current session value by using Session property of Page object. Let's see an example, how to create an access session in application.

ASP.NET Session Example

In the following example, we are creating a session and storing user email. This example contains the following files.

// Default.aspx


// Default.aspx.cs


This application will store user email to the session when user login.
ASP Net Session 1

It will show stored session value, user email.

ASP Net Session 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA