ASP.
NET Session
Session is a State Management Technique 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, [Link] session state is
enabled for all [Link] applications.
Each created session is stored in SessionStateItemCollection object. We can get
current session value by using Session property of Page object.
Example:
[Link]
[Link]
protected void Button1_Click1(object sender, EventArgs e)
{
Session["Name"] = [Link];
Session["password"] = [Link];
[Link]("[Link]");
}
By: [Link] Raval Page 1
[Link]
[Link]
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Name"] != null)
{
[Link] = Session["Name"].ToString();
}
if (Session["password"] != null)
{
[Link] = Session["password"].ToString();
}
}
[Link] Session Events
There are 2 types of events available in [Link]. We can handle both sessions in a
[Link] file.
1. Session_Start(): When the new session is initialized then the session_start event is
raised.
2. Session_end(): When the session is Expires then the Session_End event raised.
By: [Link] Raval Page 2