Change session management settings in the WebSphere Commerce configuration file (wc-server.xml)

We can change various session management settings in the WebSphere Commerce configuration file. For example, if you set the expiration time we can change the tracking behavior of the referral cookie. The referral cookie is used for marketing activities, to track the URL that referred the customer to the WebSphere Commerce site. That is, it tracks the URL that was displayed in the customer's browser immediately before navigating to the WebSphere Commerce site.


Procedure

  1. Open the WebSphere Commerce configuration file.

  2. Search for the <SessionManagement> block. For example,

      <SessionManagement>
         <url-rewriting
            display="false" enabled="false"/>
         <cookie
            acceptance="false"
            age="-1"
            display="false"
            domain=""
            enabled="true"
            path="/" persistence="wcs"/>
         <referrerCookie
            age="-1"/>
         <PersistentSession
            cookieExpiry="30"
            delayNewPersistentGuestSession="true"
            display="false" enable="true"/>
         <PersonalizationId
            display="false" enable="true"/>
      </SessionManagement>

    where:

      URL-rewriting
      See Use URL rewriting for session management.

      cookie
      See Use cookies for session management

      referrerCookie

        age
        (Integer) The age value is in seconds. If the value specified is invalid, the default value is used. Default is -1.
        The possible values are:

        • A positive value, indicating that the cookie expires after the specified number of seconds have passed. The value represents the maximum age for the cookie to expire, not the cookie's current age.

          Note: Setting the value to 1209600 indicates that the cookie expires after two weeks, maintaining its previous default behavior in WebSphere Commerce.

        • A negative value, indicating that the cookie is not stored persistently and will be deleted when the Web browser exits.

        • A value of 0, indicating that the cookie will be deleted.

      PersistentSession

        cookieExpiry
        The number of days until the cookie expires.

        cookieExpiryGuest
        The number of days until a cookie for a guest user expires. By default, the guest cookie is not defined, and cookieExpiry is used for both registered and guest users. By defining cookieExpiryGuest, the parameter is restricted to guest users, and the guest user receives a different expiry date than a registered user.

        delayNewPersistentGuestSession
        Used to delay creating a guest session for a "remember me" user. By default, this parameter is enabled (true) and a new guest session is not created until an action cannot be performed as a partially authenticated user.

        enable
        Whether persistent sessions are enabled.

      See Persistent sessions (Remember Me)

      PersonalizationId
      See Enable personalization ID.

  3. Edit the values as appropriate.


What to do next

Package our changes to the WebSphere Commerce configuration file for deployment.


Related concepts
Users
Session management
Persistent sessions (Remember Me)
Personalization ID