Click to See Complete Forum and Search --> : logout.asp problems
chrismartz
10-10-2003, 01:13 PM
i am in need of help with my logout.asp page. I was wondering how i can set my website using a link to log the user out by deleting cookie but if they aren't logged in, send them to the login page. If you know, please help.
rdoekes
10-10-2003, 01:53 PM
And how do you know the user is logged in?
If so because you set the cookie to a value, then you should check for the cookie
If Len(Request.Cookies("cookie_name")) > 0
Then if you would like to delete the cookie
Response.Cookies("cookie_name") = ""
and the cookie is deleted
So this is it:
If Len(Request.Cookies("cookie_name")) > 0 Then
Response.Cookies("cookie_name")) = ""
Else
Response.Redirect "login.asp"
End If
-Rogier Doekes