Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2005, 05:24 AM
Authorized User
 
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logoff user using ASP:

Hello:
I don't know, how to logoff a user who is currently logged in.Please can anyone send me a logoff script.Please help me as soon as possible.
Thank You.

 
Old March 19th, 2005, 11:20 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

logoff.asp
<%
Session.Abandon
Response.Redirect("login.asp")
%>




 
Old March 20th, 2005, 02:59 AM
Authorized User
 
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help:
I did what you said.
the user can logoff but still can access the resticted pages.
can you help me.

 
Old March 20th, 2005, 08:27 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

User can access the restricted pages...even after closing their browser..?

put a session variable during the login authentication..check for that session variable on all of your restricted pages otherwise redirect them to the login page...
when you log off clear that session varibale so if users try to access your restriced pages they will be redirected to the login page..
 
Old March 21st, 2005, 12:58 AM
Authorized User
 
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello:
Thanks for your help.
I still don't know what you mean by session variable and how to put it and clear it.
Please can you send me the script that i have to put on every page so the user won't be able to access the restricted pages after logging off.
Thank You.

 
Old March 21st, 2005, 12:34 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

on your checklogin page

<%
'Logic for checking your username and password
'if username and password matches initialize a session variable

Session.Contents("UserOK") = "Yes"
%>

on all of your restricted pages put this code before anything else
<%
IF Session.Contents("UserOK") <> "Yes" Then
  Response.Redirect("login.asp")
End IF
%>

on your logoff script clear this session variable using Session.Abandon

If all of the above does not make sense, Grab an ASP book and read on session variables.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Trace logoff error l.wolf Oracle 0 June 7th, 2007 05:10 AM
LogOff problem in Page aliirfan84 ASP.NET 2.0 Professional 2 May 6th, 2007 04:56 PM
Server sent email requires client logoff - why? VictorVictor ASP.NET 2.0 Professional 6 April 11th, 2007 09:50 AM
Logoff User Help ali786 Classic ASP Databases 1 March 31st, 2005 01:27 PM
How Do I Restart MySQL After Logoff/Logon spjewett Beginning PHP 6 March 29th, 2004 04:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.