alpesh_vaghasiy
02-15-2007, 02:00 PM
hello sir,
i am student of sarvajanik college of eng. & technology surat.
i am creating a website in VB.NET2003. i have already created the entire project but i am facing one problem in that.
i have created the logout page in my project.I am using session in my project. In logout page i am expiring the session. The code for that is as follows
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Session.Contents.Item("userid") = ""
Session.Contents.Remove("userid")
Session.Abandon()
End Sub
In this coding i am making userid blank.
Now from any other page in my project when i click logout i am able to logout. In all the other page except logout page i have written following code in page load event
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Session.Contents.Item("userid") = "" Then
Response.Redirect("login.aspx")
End If
End Sub
In this i am checking if the userid is blank then i am redirecting it to my login page.now suppose i have logout.so i am in logout page now.
Now the problem is that even though i have expire the session, when i click the back button in browser i am able to go back which should not happen. If am clicking any button on my page then the pageload event coding is called and i am redireted to my login page.
But i need that once i logout i should not be able to go back. By clicking back i should be redirected to my login page.
how can i do this. (what i mean to say is that consider the case of yahoo mail. when i login i am inside my mailbox. now suppose i logout then i goes to logout page. now even if i click back button in browser then i am redirected to login page and not my mailbox. This is what i want, but i don't know how to do so)
please reply me as soon as possible
hoping for a favourable reply
your truly
i am student of sarvajanik college of eng. & technology surat.
i am creating a website in VB.NET2003. i have already created the entire project but i am facing one problem in that.
i have created the logout page in my project.I am using session in my project. In logout page i am expiring the session. The code for that is as follows
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Session.Contents.Item("userid") = ""
Session.Contents.Remove("userid")
Session.Abandon()
End Sub
In this coding i am making userid blank.
Now from any other page in my project when i click logout i am able to logout. In all the other page except logout page i have written following code in page load event
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Session.Contents.Item("userid") = "" Then
Response.Redirect("login.aspx")
End If
End Sub
In this i am checking if the userid is blank then i am redirecting it to my login page.now suppose i have logout.so i am in logout page now.
Now the problem is that even though i have expire the session, when i click the back button in browser i am able to go back which should not happen. If am clicking any button on my page then the pageload event coding is called and i am redireted to my login page.
But i need that once i logout i should not be able to go back. By clicking back i should be redirected to my login page.
how can i do this. (what i mean to say is that consider the case of yahoo mail. when i login i am inside my mailbox. now suppose i logout then i goes to logout page. now even if i click back button in browser then i am redirected to login page and not my mailbox. This is what i want, but i don't know how to do so)
please reply me as soon as possible
hoping for a favourable reply
your truly