Wrox Programmer Forums
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 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 November 7th, 2006, 02:40 PM
Authorized User
Join Date: Nov 2006
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:

' 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

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") = ""
end if



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

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