Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce 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 February 19th, 2004, 11:37 AM
Registered User
 
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default log out using cookies.can it be done?

hi..
straight forward.how it is? can it be done? and another question from this coding


<%
if Request("username") = "" or (CustomersRS.eof and CustomersRS.bof) then
response.redirect "CheckOutFail.asp"
else
if Request.Form("RememberMe") = "check" then
Response.Cookies("username").Expires=Date + 365
Response.Cookies("password").Expires=Date + 365
Response.Cookies("rememberme").Expires=Date + 365
response.cookies("username")=Request("username")
response.cookies("pass")=Request("password")
response.cookies("rememberme")=Request("RememberMe ")
else
Response.Cookies("username").Expires="1/1/80"
Response.Cookies("password").Expires="1/1/80"
Response.Cookies("rememberme").Expires="1/1/80"
end if
strFn=cstr(CustomersRS("firstname"))
Response.Cookies("firstname").Expires=Date + 365
response.cookies("firstname")=ucase(left(strFn,1)) & right(strFn,len(strFn)-1)
response.cookies("Products")("CustomerID")=Custome rsRS("CustomerID")
response.redirect "index.asp"
end if
%>


how can i display in my welcome page the "username" that just log in

i wrote it this way but its not working
<%response.write(request.cookies ("username"))%>

 thank you...

-aspnewbie (learn through try and error)

 
Old February 23rd, 2004, 01:58 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Why do you want to use cookies for this when you are already querying the database for the username? If the table you are querying has first and last name as well then why not just grab those to display if not eof? With cookies you could automatically authenticate them without running a recordset. Of course, in most cases, if another user was using their machine then they would typically have access to the site as well.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log to server's event log LenexaKS Access VBA 4 March 11th, 2008 12:49 PM
Can't get Log to write the Log.txt file jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 July 31st, 2007 04:04 AM
AppException Class -Log Error to Event Log bekim BOOK: ASP.NET Website Programming Problem-Design-Solution 7 December 7th, 2004 01:01 PM
how to display username from cookies and log out? rissay Classic ASP Basics 3 February 21st, 2004 04:13 AM





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