|
 |
asptoday_discuss thread: Problem with cookies in ASP
Message #1 by "Jason Salas" <jason@k...> on Thu, 27 Jun 2002 07:28:40 +1000
|
|
I've got an interesting problem. I just deployed a cookie-based script
which worked fine locally on PWS to an NT server, but anything having to do
with cookies isn't working. Actually, I've noticed that I can write a
cookie and retrieve it's values within the same page, but I can't persist it
and extract values from page to page.
In particular, I'm having users register on a page, which takes their
values, writes them to a cookie, and then passes them to another page,
displaying a customized message. But because the main page detects for the
presence of the cookie first, the values aren't persisting, the page gets
stuck in a loop, continually going back to the registration page, not
finding the cookie.
I've racked my brain, and this really throws a wrench in my app's
architecture. Here's a portion of how I'm writing a cookie to a page:
Response.Cookies("candidateOfTheDay")("firstName") = objRS("FirstName")
Response.Cookies("candidateOfTheDay")("lastName") = objRS("LastName")
Response.Cookies("candidateOfTheDay")("graphic") = objRS("GraphicURL")
Response.Cookies("candidateOfTheDay")("party") = objRS("Party")
Response.Cookies("candidateOfTheDay")("officeSeeking")
objRS("OfficeSeeking")
Response.Cookies("candidateOfTheDay")("candidateID")
objRS("CandidateID")
Response.Cookies("candidateOfTheDay")("officeSeeking")
objRS("OfficeSeeking")
Response.Cookies("candidateOfTheDay").Expires = expireDate
If you can think of anything, please e-mail me at jason@k...
Thanks for the help!
Jason
Message #2 by "Zhang, Yongrong" <Yongrong.Zhang@R...> on Thu, 27 Jun 2002 10:38:00 -0400
|
|
The cookie is a collection.
-----Original Message-----
From: Jason Salas [mailto:jason@k...]
Sent: Wednesday, June 26, 2002 5:29 PM
To: ASPToday Discuss
Subject: [asptoday_discuss] Problem with cookies in ASP
I've got an interesting problem. I just deployed a cookie-based script
which worked fine locally on PWS to an NT server, but anything having to do
with cookies isn't working. Actually, I've noticed that I can write a
cookie and retrieve it's values within the same page, but I can't persist it
and extract values from page to page.
In particular, I'm having users register on a page, which takes their
values, writes them to a cookie, and then passes them to another page,
displaying a customized message. But because the main page detects for the
presence of the cookie first, the values aren't persisting, the page gets
stuck in a loop, continually going back to the registration page, not
finding the cookie.
I've racked my brain, and this really throws a wrench in my app's
architecture. Here's a portion of how I'm writing a cookie to a page:
Response.Cookies("candidateOfTheDay")("firstName") = objRS("FirstName")
Response.Cookies("candidateOfTheDay")("lastName") = objRS("LastName")
Response.Cookies("candidateOfTheDay")("graphic") = objRS("GraphicURL")
Response.Cookies("candidateOfTheDay")("party") = objRS("Party")
Response.Cookies("candidateOfTheDay")("officeSeeking")
objRS("OfficeSeeking")
Response.Cookies("candidateOfTheDay")("candidateID")
objRS("CandidateID")
Response.Cookies("candidateOfTheDay")("officeSeeking")
objRS("OfficeSeeking")
Response.Cookies("candidateOfTheDay").Expires = expireDate
If you can think of anything, please e-mail me at jason@k...
Thanks for the help!
Jason
======== V =========
This email message may contain legally privileged and/or confidential
information. If you are not the intended recipient(s), or the employee or
agent responsible for the delivery of this message to the intended
recipient(s), you are hereby notified that any disclosure, copying,
distribution, or use of this email message is prohibited. If you have
received this message in error, please notify the sender immediately by
e-mail and delete this email message from your computer. Thank you.
|
|
 |