Domain-level cookie across multiple domains

If you want ColdFusion to create your session cookie as a domain level cookie, for example..bar.com, and not foo.bar.com, then you can configure this in jrun-web.xml: -

<session-config>    
   <cookie-config>
          <active>true</active>
          <cookie-domain>.bar.com</cookie-domain>
   </cookie-config>
  <persistence-config>
    <active>false</active>
  </persistence-config>
</session-config>

However, this is an extended instance parameter, so if you want to run two applications on this instance or even one application with or several different top-level domains, then one of them will have sessions that do not work.

Is there a way to add multiple domains to jrun-web.xml and choose the appropriate one?

Thank.

+4
source share
4 answers

I managed to find a DTD for jrun-web.xml (the @ link at the top points to a non-existent Macromedia URL).

, XML <cookie-domain> node. , :

<cookie-domain>.domainA.com,.domainB.com</cookie-domain>

.

, , (!), , , jrun-web.xml( , , ).

+2

, <CFHEADER> cookie <CFCOOKIE>?

0
<cfapplication
   setdomaincookies=yes
   .....>

cookie cfid cftoken cookie (*.bar.com), , (foo.bar.com).

CFApplication (. setDomainCookies)

0

, cgi.server_name, application.cfc application.cfm, cookie . :

<cfapplication name="#cgi.server_name#" sessionmanagement="YES" clientmanagement="YES" sessiontimeout="#CreateTimeSpan(1,0,0,0)#" applicationtimeout="#CreateTimeSpan(1,0,0,0)#"  clientstorage="COOKIE" setclientcookies="YES">
-1

All Articles