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.
Procedure
-
Enable persistent sessions globally (handles only registered customers by default):
-
Open the Configuration Manager.
-
Expand the nodes in the Configuration Manager: .
-
In the Session Management node, select Enable persistent session.
-
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.
- Optional: Enable persistent sessions for guest
customers by enabling Migrate Guest Orders Event Listener:
- Open the Configuration Manager.
-
Expand the nodes in the Configuration Manager: .
-
In the Migrate Guest Orders Event Listener node, select Enable
Component.
- Optional:
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).
-
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.