CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Logout Help

  1. #1
    Join Date
    May 2007
    Location
    Bangalore
    Posts
    35

    Logout Help

    Hai,

    I am new to Asp.Net 2005 programming. I am using Vb.Net for serverside programming and MySql 5.0 for Database.

    Right now I am working on one web application. In that login page is there in where the user has to login to view certain no of pages.

    In that case logout option is also there. If the user clicks the logout button it clears the Session id which was generated during his login and directed him to the home page. It is working perfectly but I am facing the following problem.

    Actually when i click login button,it creates the Session by following code,

    Session("Candidate")=db.dtabl.rows(0).item("candidateid")
    response.redirect("Display.aspx")

    While loadin the display.aspx, the following code will run,

    If Not Page.IsPostBack Then
    If Session("Candidate") = 0 Then
    MsgBox("You should register your name first for view this page")
    Response.Redirect("Login.aspx")
    Else
    dblCandidateid = Session("Candidate")
    -------
    end if
    end if

    and then if i click "Logout" button in "Display.aspx", the following code will run.

    Session.Abandon()
    Session.Clear()
    Response.Redirect("Login.aspx")

    by the above code I am clearing the session and redirects to login page. It is working perfectly. But if i click the back button in browser (Note: Back button is not in my web application) it again goes to "Display.aspx". How can i overcome this issue. Coding done in Asp.Net and vb.Net 2005

    If the user clicks the Back icon in the tool bar of any browser it takes him to the previous pages(that means it is showing the pages without login by the user).

    How can i overcome this issue?

    Thanks in advance
    Last edited by g1m0v0n5; August 4th, 2008 at 08:41 AM.
    G.Manivannan, M.Sc.,[IT]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured