|
Hi,
I built a forum with login and registration.
In the default page, I have a link going to a logout.asp page which only includes:
Problem is, when I go back to the default page, I still see the user name. Which means it didn`t logout. Plus when I close my internet explorer windows and then open them again, still the user name shows.
Any ideas how can the user logout once it clicked on Logout?
Thanks,
Meytal
i call this from (default.asp?action=logout)
Here is my code:
Case "logout"
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.ExpiresAbsolute= #11/11/81#
Response.Cookies("Username") = ""
`Response.Write (Session("Username"))
Session("Username") = ""
Session.Abandon()
Response.Redirect("/forum/default.html")
|
|
|
<script for=window event=onbeforeunload>
if (event.clientX > document.body.clientWidth && event.clientY < 0)
alert("关闭窗口")
<%
`You can write logout code here!
%>
</script>
|
|
|
I like that javascript for catching the browser close event...hmmm...good to know. Thanks.
As for logging out, though, all you should need is your Session.Abandon() method call. Are you sure you aren`t also writing the username to a cookie and reading it back or in some other way getting that username that is causing you to think the session still exists? My point is, from what you posted, I think you are doing all you need to do to kill the current logged in session. So there must be something in need of fixing here!
|
|
|
|
|
My English is poor!
That code can use in IE,can`t in Netscape,so not good.but i can`t find better code.
|
|
|
|
|
<%
`
` coded by hazirkod.com
`
Session.Abandon()
Response.Redirect("/forum/default.html")
%>
|
|
|
|
|