Cookie-based session management
For security reasons, cookie-based session management uses two types of cookies:
- Non-secure session cookie Used to manage session data. Contains an activity identifier that points to attributes such as the negotiated language, current store, and customer's preferred currency at the time the cookie is constructed. This cookie can flow between the browser and server under either SSL or non-SSL connection. There are two types of non-secure session cookies:
- A Open Liberty Server session cookie is based on the servlet HTTP session standard. Open Liberty Server cookies persist to memory or to the database in a multinode deployment. For more information, see the Session management support topic.
- an Commerce+ session cookie is internal to Commerce+ and does not persist to the database. All the cookies persist to memory except the persistent cookie. This configuration is the default. This configuration is required if URL rewriting is enabled.
- Secure authentication cookie
Used to manage authentication data. An authentication cookie flows over SSL and is time-stamped for maximum security. This cookie is used to authenticate the user whenever a sensitive command is run. For example, the
DoPaymentCmd, which asks for a user credit card number. There is minimal risk that this cookie might be stolen and used by an unauthorized user. Authentication code cookies are always generated by Commerce+ whenever cookie-based session management is in use.
- Prior to Commerce+ 9.1.6.0, the
WC_AUTHENTICATIONandWC_IdentitySignaturecookies were the only cookies with the secure attribute set. - All session cookies now have the secure attribute set. This enhanced behavior can be disabled, but it is not recommended.
Both the session and authentication code cookies are required to view secure pages.
For cookie errors, the CookieErrorView is called:
- When the user logs in from another location with the same Logon ID, and multiple logon is not enabled.
- When the cookie is corrupted, tampered with, or both.
- If cookie acceptance is set to
trueand the user browser does not support cookies.
If the browser is configured to not destroy session cookies when it is closed, the cookies that are used for user identification and authentication remain active after the browser is restarted. In the case of a registered user, the user remains logged in. In the case of a guest user, all the assets that are associated to the user, such as pending carts, orders, or addresses, remain associated to the session in the browser. This behavior is caused by the browser not destroying session cookies, and it affects all sites that are accessed from the browser in the same way.
The default configuration for Commerce+ is that when a user registers or logs in, the assets that are associated to the guest user before they login are transferred to the registered user account. These assets include addresses, orders, and interest items. This scenario might be a concern if the browser is shared and if it is configured to not destroy session cookies upon closure. For example, a guest user might place an order and close the browser. The following day, a different person might open the same browser and log in. Because the guest user session remains active, its assets, including the order that is placed and addresses used, are associated with the registered user that logged in.
The following options are available to avoid this scenario:
- Customize the MigrateUserEntriesCmd command, which is used to migrate addresses, orders and interest items from the current guest user session to the user that logs in. You can customize the command so that certain assets are not copied by replacing the method with an empty implementation.
- After a guest user places an order, automatically issue the Logoff command to reset the guest user session to the generic user.
Preserved session cookies to not present the same concern for registered users because these shoppers can use the Logoff link to clear their session information.
Browsers running on personal or mobile devices, such as phones or tablets, have the same issues as shoppers who use a browser in a public setting. These types of devices are not typically shared, so they do not present the same privacy concerns. However, shoppers on personal or mobile devices do not typically end the browser application after they browse a site, so session cookies are not destroyed. The options that are provided for protecting the privacy of shoppers in a public setting also apply to browsers that run on personal or mobile devices.
Commerce+ session cookies
| Cookie name | Description |
|---|---|
| _AN_CGID_COOKIE | Stores the categories visited by a user, which is later used by the following Analytics tags: Product tag, Cart tag, and Order tag. |
| REFERRER | The value of referer in the HTTP header. |
| WC_ACTIVEPOINTER session cookie | This cookie contains the value of the store ID of the session. This value is
used to select the store to run the command, if one is not specified on the URL.
|
| SESSION_COOKIEACCEPT | Checks whether the client browser accepts cookies. |
| WC_AUTHENTICATION_ID session cookie | Commerce+ uses a secure authentication cookie to manage
authentication data. An authentication cookie flows only over SSL. For increased security, it has a
timestamp with a signature. This cookie is used to authenticate the user over SSL-connections.
|
| WC_GENERIC_ACTIVITYDATA session cookie | This cookie exists only if it is a generic user (-1002)
session. This cookie stores the session values such as store ID, language ID, and contracts.
|
| WC_SESSION_ESTABLISHED session cookie | This cookie is created on the first request that is processed by Commerce+ run time. For example, a non-cache request.
|
| WC_USERACTIVITY_ID session cookie | This cookie is a user session cookie that flows between the browser and server
over both SSL or non-SSL connection. It is used for user identification over non-SSL connections. It
contains user session values such as the session login time, and session identifier information such
as the user ID and store ID.
|
| LTPA2 cookie WebSphere Application Server cookie |
This cookie is used when Commerce+ enabled for single sign-on with other WebSphere applications information center. |
| WC_EdgeCacheComponent_storeId | Used for Edge Caching. |
| WC_identitySignature | Commerce Lab session cookie. |
| fulfillmentCenterId | Fulfillment center selected in Accelerator. |
| LtpaToken2 | Open Liberty Server LTPA token used for single sign on. |
- All session cookies, except for WC_SESSION_ESTABLISHED, can be used in the Commerce Lab
preview environment. In the preview environment, the session cookie name is prefixed
with
WCP_. The cookies support sessions and users in the preview environment. - The value of session cookies is encrypted by using the session encryption key. For more information, see ../tasks/tsechangesessionkey.html.