sean2078
sean2078

Reputation: 5460

How do you read cookie values in ColdFusion that have special characters in the name?

I'm working with ColdFusion trying to read the value stored in a session cookie named "LiSESSION:test-0". The cookie is stored in the "test.com" domain, from code ran from "community.test.com" and I don't have access to the code to change the name. I am reading the value from "test.com" which is how I am able to access the cookie.

For example:

<cfparam name="cookie.LiSESSIONID:test-0" type="string" default="" />

.. raises an error saying that ":" is an invalid character ("Invalid parser construct").

Upvotes: 5

Views: 2765

Answers (1)

Peter Boughton
Peter Boughton

Reputation: 112200

Same way you do it with all variables (not just cookies) - by using bracket notation:

Cookie['LiSESSIONID:test-0']

Upvotes: 6

Related Questions