Results 1 to 3 of 3

Thread: Why logout does not work in ASP.NET

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Answers
    1

    Why logout does not work in ASP.NET

    Manually session check to enter in a web page in asp.net. It works fine.When logout, works fine. But, after logout , when press browser back button it back to the previous page, session check not work.Why?

    code for page_load() with session check:
    protected void page_load()
    {
    if(session["id"]==null)
    {
    server.Transfer("../Index.aspx");
    else
    {
    // ....
    }
    }
    }

    code for logout button:
    {
    session["id"]=null;
    server.Transfer("../Index.aspx");
    }


  2. #2
    Junior Member
    Join Date
    Mar 2008
    Answers
    1

    Re: Why logout does not work in ASP.NET

    you have to use javascript for disable back button.



    Last edited by aditi.ptl; 03-14-2008 at 10:33 AM.

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Answers
    1

    Re: Why logout does not work in ASP.NET

    Add Session.Abandon();
    code for logout button:
    {
    session["id"]=null;
    Session.Abandon();
    server.Transfer("../Index.aspx");
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact