I have an Application.cfc with the following settings:
<cfset THIS.Name = "Test01" />
<cfset THIS.ApplicationTimeout = CreateTimeSpan(1,0,0,0) />
<cfset THIS.sessionTimeout = CreateTimeSpan(1,0,0,0) />
<cfset THIS.clientManagement = false />
<cfset THIS.SessionManagement = true />
<cfset THIS.SetClientCookies = false />
<cfset THIS.setDomainCookies = false />
And I attempted to send the following cookies:
<cfcookie name="CFID" value="#session.CFID#" domain=".test01.domain.net" path="/" expires="never">
<cfcookie name="CFTOKEN" value="#session.CFTOKEN#" domain=".test01.domain.net" path="/" expires="never">
However, what gets sent to the browser is:
Set-Cookie: CFID=6389; Domain=.domain.net; Expires=Fri, 12-Jun-2043 22:14:17 GMT; Path=/; HttpOnly:
Set-Cookie: CFTOKEN=783fa62afecfd571%2DB1069303%2D3048%2D3344%2DAA97ADAF73598FA6; Domain=.domain.net; Expires=Fri, 12-Jun-2043 22:14:17 GMT; Path=/; HttpOnly
No matter what values I put in domain or path, it always sends those same headers. If I try to use cfheader
it simply sends nothing. The only time I can get it to send cookie headers without a domain value is by setting SetClientCookies
to true:
Set-Cookie: CFID=6391; Expires=Fri, 12-Jun-2043 22:21:38 GMT; Path=/; HttpOnly
However I can no longer get rid of the cookies by using StructDelete
nor CFCookie
with the attributes expires now (in fact it creates a second set of cookies).
My main goal is to simply send CFID and CFTOKEN cookies without a domain (or at the very least without a leading period, e.g. test01.domain.net)