Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 7th, 2006, 02:40 PM
Authorized User
 
Join Date: Nov 2006
Location: Washington, DC, .
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via Yahoo to webXtreme
Default ASP Logout Script

I have a simple web page where the user must log-in before viewing any of the pages posted. However, I want them to click the logoff link to clear all cookies and redirect them to another page. Can someone take a look at this and let me know if I'm missing something!!! It looks right to me. Here's my code:

LOG-IN VALIDATE USER CODE:
*************************************************
' execute sql and open as recordset
sqlStr = "Select * FROM usrpssd where username = '" _
            & Request.Form("username") & "' and password = '" & Request.Form("password") & "'"

' Opens the returned values from the SQL as a recordset, ready for iteration by ASP
set rcSet = cnStr.Execute(sqlStr)

' validate variables against database
If (not rcSet.BOF) and (not rcSet.EOF) then
response.cookies("validated_user") = frmUsername
response.redirect("/htm/default.asp")

else
response.redirect("/htm/login/error.asp")
end if
%>
************************************************** ***********

LOGOFF USER CODE (this is the code I'm having trouble with):
************************************************** ***********

<%

if response.cookies("validated_user") = frmUsername then
response.cookies("validated_user") = ""
response.redirect("/htm/login/logoff.asp")
end if

%>


webXtreme
__________________
webXtreme
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LogOut in ASP.NET Manoj Bisht ASP.NET 2.0 Professional 3 March 4th, 2008 09:25 AM
Simple Logout Script webXtreme ASP.NET 1.0 and 1.1 Basics 0 November 7th, 2006 01:18 PM
Asp.net Logout problems hemal_301080 ASP.NET 1.0 and 1.1 Professional 1 August 6th, 2006 12:16 PM
Disply Logout Time in asp dayarprasad MySQL 1 June 22nd, 2006 08:43 AM
Logout Problem ASP chaitanya_puri Classic ASP Professional 1 December 2nd, 2004 08:47 PM



All times are GMT -4. The time now is 11:01 PM.


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