SessionId – keeping it the same

If you don’t populate a value in the session of a page then the session Id will reset everytime the page is loaded.

protected void Page_PreInit(object sender, EventArgs e)
{
    //Need this line otherwise it resets the Session Id everytime!
    Session["keepme"] = "True";
}


Leave a Reply