Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking If Cookies Already Exist

Status
Not open for further replies.

LongFeiFengWu

Technical User
Nov 9, 2001
98
US
I have a page where users are required to sign in. When they sign in, cookies are written to the user's system so I can use the data on other pages. What I'd like to accomplish is to check the user's system for the existence of a specific cookie before they're sent to the login page, so that they don't have to keep logging in on each visit to the page. How would I do something like that? Any help is greatly appreciated.

"If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo." ~ Bruce Lee
 
Ok, I figured my first question out on my own. Wasn't hard at all. Now, what I need is to set the expiration of a cookie. I write my cookies like this:

response.cookies("ECT")("VZID") = objrec("VZID")

how do i set the expiration for that?

"If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo." ~ Bruce Lee
 
the syntax is nearly identical :

response.cookies("ECT")("VZID").Expires = datetimevalue

example :

response.cookies("ECT")("VZID").Expires = date() + 7 '( expires 1 week )
 
would i write that in addition to the other line?

so would it be:

response.cookies("ECT")("VZID") = objrec("VZID")
response.cookies("ECT")("VZID").expires = date() + 7

"If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo." ~ Bruce Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top