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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fetching a cookie

Status
Not open for further replies.

khue

Programmer
Mar 6, 2001
112
US
How, do I access a cookie in coldfusion 5 written by Javascript code?

This is what I have in Coldfusion but it doesn't work?

Assuming the cookie is written already in Javascript with the name CalendarID...

<CFIF IsDefined(&quot;Cookie.CalendarID&quot;)>
<CFSET curCal = &quot;Cookie.CalendarID&quot;>
<CFELSE>
<CFSET curCal = &quot;&quot;>
</CFIF>

Can someone help??
 
This is a tricky situation. Remember this:

1. The cookie is not available to the template that wrote the cookie. You can't test for it from the same place.

2. The cookie is not available to any template that was reached by a CFLOCATION from the template that wrote the cookie.

3. If you write a cookie through Javascript, the Web server won't be able to know a thing about it until subsequent requests to the Web server.

HTH,
Phil Hegedusich
iimaksmall.gif
 
I know that much already and it doesn't help me. Is there a way around it?

It seems to me as though the cookie written by Javascript from a coldfusion page is only local and visible to that coldfusion page, but another coldfusion page cannot see it. Why? How can I make every coldfusion page to see this cookie and access it when ever I want to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top