---
title: "ta bort när användare loggar ut"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/8478-ta-bort-när-användare-loggar-ut"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "andreas_lindh"
published: "2001-03-11T10:15:00.000Z"
updated: "2001-03-11T10:46:00.000Z"
replies: 1
views: 189
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/8478-ta-bort-när-användare-loggar-ut"
---

# ta bort när användare loggar ut

## #1 — andreas_lindh, 2001-03-11T10:15Z

Har en chat. Där visar jag vilka som är online. men när användaren loggar ut försvinner inte hans namn från onlinelistan. Hur ska jag göra för att namnet ska tas bort?
Koden ser ut så här:
Jag hämtar namnen med \<%=Application("slot1")%\>
och global.asa ser ut så här:
\<script language="VBScript" runat="Server"\>

Sub Session_OnStart
	Session.Timeout = 5
	Application("visitors") = Application("visitors") + 1
End Sub

Sub Session_OnEnd
Application("visitors") = Application("visitors") - 1
APPLICATION.LOCK

If Application("slot1") = Session("user") then Application("slot1") = ""
If Application("slot2") = Session("user") then Application("slot2") = ""
If Application("slot3") = Session("user") then Application("slot3") = ""
If Application("slot4") = Session("user") then Application("slot4") = ""
If Application("slot5") = Session("user") then Application("slot5") = ""
If Application("slot6") = Session("user") then Application("slot6") = ""
If Application("slot7") = Session("user") then Application("slot7") = ""
If Application("slot8") = Session("user") then Application("slot8") = ""
If Application("slot9") = Session("user") then Application("slot9") = ""
If Application("slot10") = Session("user") then Application("slot10") = ""
If Application("slot11") = Session("user") then Application("slot11") = ""
If Application("slot12") = Session("user") then Application("slot12") = ""
If Application("slot13") = Session("user") then Application("slot13") = ""
If Application("slot14") = Session("user") then Application("slot14") = ""
If Application("slot15") = Session("user") then Application("slot15") = ""
If Application("slot16") = Session("user") then Application("slot16") = ""
If Application("slot17") = Session("user") then Application("slot17") = ""
If Application("slot18") = Session("user") then Application("slot18") = ""
If Application("slot19") = Session("user") then Application("slot19") = ""
If Application("slot20") = Session("user") then Application("slot20") = ""
APPLICATION.UNLOCK
End Sub
Sub Application_OnStart
	Application("visitors") = 0
End Sub

\</script\>
logga ut sidan ser ut så här
\<% session.abandon
response.redirect("default.asp")
%\>

Permalänk: https://www.webforum.nu/p/8478

## #2 — crisse6, 2001-03-11T10:46Z

du vet om man kan hitta någon chat utan global.asa? jag håller på att letar efter en liten chat...

Permalänk: https://www.webforum.nu/p/260868

---

Tråden på webben: https://www.webforum.nu/amne/asp/8478-ta-bort-när-användare-loggar-ut
