Enabling global persistent sessions

WebSphere Commerce can be configured to enable persistent sessions for both registered and guest users. Enabling persistent sessions allows for some session-related information of the user to be stored as permanent cookies. If persistent sessions are enabled, a customer at a WebSphere Commerce store will be recognized on subsequent visits to the store, even after the customer closes the browser. To enable persistent sessions for a particular store, you must first enable persistent sessions globally, and then enable them for the specific store.

Note: You can enable persistent sessions globally on your Developer environment. For more information, see: Enabling global persistent sessions (Developer).

Procedure

  1. Enable persistent sessions globally (handles only registered customers by default):
    1. Open the Configuration Manager.
    2. Expand the nodes in the Configuration Manager: WebSphere Commerce > node_name > Commerce > Instance List > instance_name > Instance Properties > Session Management.
    3. In the Session Management node, select Enable persistent session.
    4. In the Cookie Expiry (days) field, enter the number of days that you want the session to last. If the customer logs on to the store within the specified number of days, their session is persisted. A value of -1 indicates that the cookie is removed at the end of a browser session, and a value of 0 is not supported.
  2. Optional: Enable persistent sessions for guest customers by enabling Migrate Guest Orders Event Listener:
    1. Open the Configuration Manager.
    2. Expand the nodes in the Configuration Manager: WebSphere Commerce > node_name > Commerce > Instance List > instance_name > Components > Migrate Guest Orders Event Listener.
    3. In the Migrate Guest Orders Event Listener node, select Enable Component.
    4. Optional: Feature Pack 8 Set a different expiry value for the guest customer cookie. To set the value of cookieExpiryGuest, see Changing session management settings in the WebSphere Commerce configuration file (wc-server.xml).
  3. Enable persistent sessions in a single store. Enabling persistent sessions in a single store ensures that your store is configured to handle persistent sessions. For example, your STORE.PERSISTENTSESSION value must correspond to the configuration you want to support, such as remembering registered customers only, or remembering both registered and guest customers. If you want registered customers to use persistent session features, you must also create a check box on the logon and registration page that enables the feature for their account.
    Note: You might need to update store JSP pages to ensure your persistent session option displays correctly.