PDA

View Full Version : [Help] - Sign Out code


Haidar
01-08-2010, 01:08 AM
Hey!

I have looked abit around this forum and i did see many active people trying to help in asp, so i wonder if you could help a newbie like me :thumbsup:

Question:
I have made an beginner login system and the pages is secuired with those codes:
at the top
<%
session.Timeout = 50
' timeout in minute
loginstatus = session("login")
if loginstatus = "yes" then
%>
and at the bottom of the page

<%
else
Response.Redirect "login.asp"
end if
%>

So you have to login if you want to get acced to other pages but how do i make an sign out link? I have tried many ways with session and other examples but it dosen't work i still can press the hit back button and get access. Please any help?

Indeed sorry for my bad english and i really dont know if those code i post wont to help to solve the problem :P hope u help me!

angst
01-08-2010, 02:38 PM
you need to use "Session.Abandon"

have a look here: http://www.w3schools.com/ASP/asp_sessions.asp


also, for this "if loginstatus = "yes" then"

it's better if you use true/false, then yes or no.

so to check if the variable is true you can just:

if loginstatus then
' do nothing
end if

Haidar
01-09-2010, 07:21 PM
Now i'm really gettin crazy about that session thing. I have read all forums and that page you post... i used this code in my sign out page.

<%
Session.Abandon()
%>

but if i hit the back button or only write like the url/index.asp i gett access :S! Can someone please just post the code i need to fix the sign out?!?