codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Logout Problem  Archive Import (meytal) at 10:39 on Sunday, July 20, 2003
 

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")




  Re: Logout Problem  Archive Import (sunway) at 05:43 on Saturday, July 26, 2003
 

<script for=window event=onbeforeunload>
if (event.clientX > document.body.clientWidth && event.clientY < 0)
alert("关闭窗口")
<%
`You can write logout code here!
%>
</script>

  Re: Logout Problem  Troy Wolf at 16:57 on Tuesday, July 29, 2003
 

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!
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: Logout Problem  Archive Import (sunway) at 23:16 on Friday, August 01, 2003
 

My English is poor!
That code can use in IE,can`t in Netscape,so not good.but i can`t find better code.

  Re: Logout Problem  Archive Import (sunway) at 02:09 on Sunday, August 24, 2003
 

Use Unload Event!

<body onunload="if (window.screenLeft >= 10000 && window.screenTop >= 10000) alert(`关闭窗口`); else alert(`页面重载`)">

From:http://www.blueidea.com/bbs/NewsDetail.asp?GroupName=Dreamweaver+%26+Javascript%D7%A8%C0%B8&DaysPrune=5&lp=1&id=1146373

  Re: Logout Problem  Archive Import (Mehmet aLTINDAGLI) at 06:53 on Tuesday, August 26, 2003
 

<%

`
` coded by hazirkod.com
`
Session.Abandon()
Response.Redirect("/forum/default.html")

%>

  Re: Logout Problem  Elain at 08:14 on Friday, November 12, 2010
 

You can change a browser t login again or your account is banned!
---------------------------------------
flash banner|logo maker|flash menu








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: converting pst files from outlook to excel??
•  item to item recomender system
•  Re: Database Design
•  Re: Very difficult DHTML:How to add css font class to table cells
•  Re: error
•  Re: Logout Problem
•  Re: about disable form
•  Re: open excel file in html page
•  Re: Connection Problem help needed


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010