Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why doesn't cfcookie allow setting domain= to a subdomain for CFID/CFTOKEN?

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

yields:

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

But if I use <cfheader> directly:

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

yields:

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

And that's really what I want.

Why does <cfcookie> behave this way? Current workaround would be using <cfheader> instead.

like image 549
Henry Avatar asked Nov 12 '22 01:11

Henry


1 Answers

Have you reproduced this error with a leading . in the domain value? According to CF8, CF9 and CF10 docs, the domain attribute value Must start with a period..

like image 54
Alex Avatar answered Nov 15 '22 11:11

Alex