Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
C#
protected void btn_fourthPage_Click(object sender, EventArgs e)
{
    try
    {
        HttpContext.Current.Session["fourthpage"] = "4";
        Response.Redirect("~/LoginPage.aspx",false);
    }
    catch (Exception ex)
    {
        Response.Write(ex.Message);
    }
}

can any one explain how 4 is assigned
Posted
Updated 28-Jun-13 0:25am
v2

 
Share this answer
 
Comments
Thanks7872 28-Jun-13 7:02am    
Good one.↑voted. Elaborated lil bit in my below answer.
_Amy 28-Jun-13 7:09am    
Thank You. :)
Thanks7872 28-Jun-13 7:10am    
You are welcome Amit
Refer to this link

Exploring Session in ASP.NET[^][Provided in above answer also]

It states that

Quote:
ASP.NET uses an 120 bit identifier to track each session. This is secure enough and can't be reverse engineered. When a client communicates with a server, only the session ID is transmitted between them. When the client requests for data, ASP.NET looks for the session ID and retrieves the corresponding data. This is done in the following steps:

-Client hits the web site and information is stored in the session.
-Server creates a unique session ID for that client and stores it in the Session State Provider.
-The client requests for some information with the unique session ID from the server.
-Server looks in the Session Providers and retrieves the serialized data from the state server and type casts the object.


Refer to this also

HttpSessionState.SessionID Property[^]

Regards.. :laugh:
 
Share this answer
 
v3
Comments
_Amy 28-Jun-13 7:09am    
My +5!
Thanks7872 28-Jun-13 7:10am    
Thanks Amit.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900