locked
Hi .I have problem with back.. RRS feed

  • Question

  • Hi .I am developing a web application with login.In my master page i put logout button and whn i click logout i am clearing my sessions with session.clear(). and redirecting page to login page.

     

    Wht my problem is whn click back button of browser after logout it is showing my previously opened page page even i m clearing my sessions.please suggestion some solutions ..whn i google i got solutions like

    Response.Cache.SetCacheability(HttpCacheability.NoCache); in all pages but i think it is not the proper solution..

     

    Please suggestion some solutions which is appropriate.

    • Moved by Neddy Ren Friday, February 18, 2011 1:32 AM asp.net issue (From:Visual C# Language)
    Thursday, February 17, 2011 10:47 AM

All replies

  • Hello vishveshk

    I have some suggestion . Please try this

    At logout button when are you clearing Session.Clear();

    Then write it

    Session.Abandon();

    And check in your Master Class Page.

     page_load() event . Please Check

     

    if(Session["GivenValue"]== null)

    Response.Redirect("LogOut.aspx");

     

    Thanks


    Sankarshan Parida.Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Thursday, February 17, 2011 11:39 AM
  • hi thanks for reply..

    this is working quite well

    Session.clear();//clear session
    Session.Abandon();//Abandon session
    Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetNoStore();
    Response.Redirect("Logout.aspx");

    Thursday, February 17, 2011 12:24 PM