开发者

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

开发者 https://www.devze.com 2023-01-08 03:19 出处:网络
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\" a

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="" />开发者_JS百科

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


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

Cookie['LiSESSIONID:test-0']
0

精彩评论

暂无评论...
验证码 换一张
取 消