close

Filter

loading table of contents...

Connector for HCL Commerce Manual / Version 2010

Table Of Contents

3.5 Configuring the Cookie Domain

Note

Note

This is only necessary when you use AJAX calls (for Elastic Social, for example) in the commerce-led scenario.

Since the CAE must know about generated commerce cookies and vice versa, it is necessary to configure specific cookie domains for both, the CAE and the commerce system, so that cookies are exposed to both systems.

The CoreMedia system must be hosted on servers belonging to the same domain. Example: If the domain given here is .xyz.com, then the CoreMedia CAE must be accessed from the commerce system via a (logical) server name servername.xyz.com.

In order to enable session synchronization between the CoreMedia and HCL Commerce system do the following steps:

  1. Enable the com.coremedia.livecontext.hybrid.CookieLeveler within the web.xml of your commerce store front(WCDE-INSTALL/workspace/Stores/WebContent/WEB-INF/web.xml) and preview(WCDE-INSTALL/workspace/Preview/WebContent/WEB-INF/web.xml) webapp. Put its filter mapping in front of all other filter mappings and set the cookie domain to the shared domain of your CAE and commerce system.

    <filter>
      <filter-name>Cookie Leveler</filter-name>
      <filter-class>com.coremedia.livecontext.hybrid.CookieLeveler</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>Cookie Leveler</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
    
    <context-param>
      <param-name>com.coremedia.fragmentConnector.cookieDomain</param-name>
      <param-value>.FQDN</param-value>
    </context-param>
  2. If you want to rewrite additional cookies of your own commerce customizations, you can configure a list of all cookies to be rewritten via a comma separated list.

    <filter>
      <filter-name>Cookie Leveler</filter-name>
      <filter-class>com.coremedia.livecontext.hybrid.CookieLeveler</filter-class>
      <init-param>
        <param-name>cookieFilter</param-name>
        <param-value>WC_,WCP_,myCustomCookie</param-value>
      </init-param>
    </filter>

    Per default commerce cookies starting WC_ and WCP_ are mapped.

  3. Set the cookie domain for the JSESSION cookie on the commerce server, for example via the HCL console.

For the CAE the cookie domain is configurable in the Tomcat configuration file context.xml. The cookie domain can be set here by setting the attribute sessionCookieDomain for the Context element. The cookie domain must be configured with a leading "." so that the CAE session cookie is readable from commerce system that run with the same subdomain, for example .myDomain.com.

Search Results

Table Of Contents