Why does cfcookie not allow setting domain = to a subdomain for CFID / CFTOKEN?

<cfcookie name="CFID" value="#session.cfid#" domain=".demo.labs.dev"> 

gives:

Set-Cookie: CFID = 4215; Domain = .labs.dev; Expires = Sat, 04-Jul-2043 01:43:49 GMT; Path = /; HttpOnly

But if I directly use <cfheader> :

 <cfheader name="Set-Cookie" value="CFID=4212; Domain=.demo.labs.dev; Expires=Sat, 04-Jul-2043 01:37:03 GMT; Path=/; HttpOnly"> 

gives:

Set-Cookie: CFID = 4212; Domain = .demo.labs.dev; Expires = Sat, 04-Jul-2043 01:37:03 GMT; Path = /; HttpOnly

And this is really what I want.

Why is <cfcookie> behaving like this? The current <cfheader> will use <cfheader> .

+6
source share
2 answers
0
source

You reproduced this error with a host . in domain value? According to CF8 , CF9 and CF10 docs, the value of the domain attribute Must start with a period. .

+1
source

Source: https://habr.com/ru/post/949175/


All Articles