I have setup my ColdFusion application to set HTTPOnly cookies using the code below (from http://www.petefreitag.com/item/764.cfm):
<cfcomponent output="false">
<cfscript>
THIS.Name = "MyCFApp";
THIS.SessionManagement = true;
THIS.SetClientCookies = false;
THIS.SessionTimeout = CreateTimeSpan(0, 3, 0, 0);
THIS.ApplicationTimeout = CreateTimeSpan(0, 8, 0, 0);
</cfscript>
<cffunction name="onSessionStart" returntype="Void" output="false">
<cfheader
name="Set-Cookie"
value="CFID=#SESSION.CFID#;path=/;HTTPOnly;#APPLICATION.SECURE_COOKIES#;" />
<cfheader
name="Set-Cookie"
value="CFTOKEN=#SESSION.CFTOKEN#;path=/;HTTPOnly;#APPLICATION.SECURE_COOKIES#;" />
<cfreturn />
</cffunction>
</cfcomponent>
(FYI, APPLICATION.SECURE_COOKIES
allows me to set an application-specific value for secure cookies - production is SSL, so I can do secure, but my local dev environment is not SSL, so this is empty.)
When I clear my cookies/session in Google Chrome, and reload the page, I can see the Set-Cookie
response headers in the debugger:
When I inspect the cookies in the debugger, they are flagged as HTTPOnly:
When I do the same in IE9, I can see the Set-Cookie
headers in the debugger:
But, for the same request, the cookies are visible in the debugger:
When I reload in IE9, the cookies are visible, but not flagged as HTTPOnly:
What is going on here with IE9? How can I resolve this to properly set HTTPOnly Cookies?