Click to See Complete Forum and Search --> : Logout Help


g1m0v0n5
August 2nd, 2008, 03:01 AM
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