954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help regarding session

i have made 2 pages....1 for login n next to show after successful login....
on login page i have created a button....in its handler i have created session.... on the load event of next page i m checking for the availibity of the session variable n its value.... its workin well..... but the problem comes when i press back button of the browser.....after signing out when i press back button the page is being displayed.....(this should not happend).... can anyone help me regarding this...?? plz reply soon....

eimmu
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

Use the following code in ur head tag

i have made 2 pages....1 for login n next to show after successful login.... on login page i have created a button....in its handler i have created session.... on the load event of next page i m checking for the availibity of the session variable n its value.... its workin well..... but the problem comes when i press back button of the browser.....after signing out when i press back button the page is being displayed.....(this should not happend).... can anyone help me regarding this...?? plz reply soon....
Sals
Light Poster
33 posts since Jan 2009
Reputation Points: 10
Solved Threads: 6
 

Turn off client & proxy cache,

protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        if (Session["iskey"] == null)
        {
            Response.Redirect("~/Login.aspx");
        }
    }
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You