|
-
Feb 19th, 2001, 12:12 PM
#1
Thread Starter
PowerPoster
Hello all. I am new to writing cookies. I have a website and my user registration and log in page work fine. I can limit their session on the site by using a session variable but I now want to use cookies to recognize my registered users and populate various fields automatically so that my site becomes more functional.
Who can help and show me the code?
thanks!
-
Feb 19th, 2001, 12:22 PM
#2
Guru
This should work, double check the Expires property though....
To write a cookie
Response.Cookies("MyCookie") = "Hello World!"
Response.Cookies("MyCookie").Expires = "1/1/2002"
To read a cookie
response.write request.cookies("MyCookie")
-
Feb 19th, 2001, 12:24 PM
#3
Thread Starter
PowerPoster
forgive me for my dumbness but do I insert the
Response.Cookies("MyCookie") = "Hello World!"
Response.Cookies("MyCookie").Expires = "1/1/2002"
AFTER they log in or while they log in?
And after that where do I place the
response.write request.cookies("MyCookie") ?
-
Feb 19th, 2001, 03:14 PM
#4
Banned
Jesus4u,
Check out http://www.w3scripts.com/asp/asp_cookies.asp tutorial for a lesson on ASP cookies.
-
Feb 19th, 2001, 11:45 PM
#5
Fanatic Member
Also try this for the cookie expiry date
Code:
Response.Cookies("MyCookie").Expires = Date() + 30
or
Response.Cookies("MyCookie").Expires = Date() + 60
to make cookie expire after 30 or 60 days
rather than entering a dtae cos yo make a typo
DocZaf
{;->
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|