ASP Forum
Login / Logout Session
Graham Lewis | Posted 7:53am 17. April 2002 Server Time |

I have a login page that uses Session Cookies to take a user to a secure page. Stupid question probably, but, how do I securely log them out again without closing the browser window. i.e a  logout button taking them back to the login page.

Thanks

Graham
eric1973 | Posted 8:53am 17. April 2002 Server Time |

You can just use Session.Abandon on the page that logs them out.

Eric
Graham Lewis | Posted 9:16am 17. April 2002 Server Time |

I tried this but it doesn't seem to work. I can just use the back button to return to the secure page?
valkyr | Posted 11:17am 17. April 2002 Server Time |

You can make the login page clear the session variables when it first opens, which basically logs the user out.
enigma | Posted 1:14pm 17. April 2002 Server Time |

Also it would be a very good idea to expire the page & its cache at the beginning...

enigma
Graham Lewis | Posted 0:27am 18. April 2002 Server Time |

How do you expire the page and it's cache?
valkyr | Posted 2:22am 18. April 2002 Server Time |

Putting this:

<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
%>

At the top of the page should do it.
change | Posted 6:22am 15. November 2007 Server Time |

im a novice and am failing to understand how cookiies really work... can someone volunteer to walk me through them.....help
WizzKidd | Posted 5:44am 6. December 2007 Server Time |

There are really only two basic things to do with cookies:
   1. Write them to the visitor's computer (using the RESPONSE command)
   2. Retrieve them from the visitor's computer (using the REQUEST command)

1. Example of Writing a cookie:
<%
  Response.Cookies("VisitorsName") = "change"
  Response.Cookies("VisitorsName").Expires=#January 01, 2010#
%>

2. Example of Reading a cookie:
<%
  Dim TheVisitorsName
  TheVisitorsName = Request.Cookies("VisitorsName")

  Response.Write(TheVisitorsName)
%>


- WizzKidd


Reply to Post Login / Logout Session



Back to Forum Page