Web Agents

Cookies

Learn more about securing your cookies in Manage cookies.

By default, the agent’s single sign-on (SSO) token cookie name is iPlanetDirectoryPro.

Unless you use Accept SSO Token mode or have enabled Custom Login Mode, you should remove the default cookie name value from the agent. A blank value ensures the agent gets the correct cookie name from AM for authentication.

You only need to set the agent’s cookie name to a specific value if you use custom login mode or accept SSO token mode and want to use a cookie different from the one defined in the realm.

If you’re using Advanced Identity Cloud, you don’t need to change the agent cookie name because the agent automatically uses the Advanced Identity Cloud session cookie name for authentication.

You can change the name of the cookie for a specific agent or for an agent group in AM.

  1. In the AM admin UI, go to Realms > Realm Name > Applications > Agents > Web > Agent Name.

  2. On the SSO tab, remove the default value from the Cookie Name field or enter the SSO token cookie name, if applicable.

  3. Click Save Changes.

  1. In the AM admin UI, go to Realms > Realm Name > Applications > Agents > Web, and select the Groups tab followed by the Group ID.

  2. On the SSO tab, remove the default value from the Cookie Name field or enter the SSO token cookie name, if applicable.

  3. Click Save Changes.

The agent sets a browser session cookie named agent-authn-session when an unauthenticated client first requests an enforced resource. The cookie holds a random value, and the agent reuses it for every authentication flow in the same browser session. The cookie doesn’t carry pre-authentication state; it binds the state to the client’s browser session:

  • The agent encrypts the pre-authentication state, using the cookie value as additional authenticated data, and adds the result to the redirect URL to AM.

  • When the authentication response returns to the agent, the agent honors the response only when the state is still bound to the cookie value.

The agent can’t decrypt state that arrives from a browser session other than the one that started the login. A login started in one browser session can’t be completed in another.

The cookie is a host-only browser session cookie with Path=/. It has no expiry attribute, and the browser deletes it when the browser session ends.

The cookie’s HttpOnly, Secure, and SameSite attributes are set according to the agent’s HTTP-only, cookie security, and SameSite properties.

If the cookie is missing when the authentication response arrives, the agent can’t decrypt the state. The agent redirects the client to the agent root URL and restarts the authentication flow.

Web Agent can reset cookies before redirecting the client to a login page, by issuing a Set-Cookie header to the client to reset the cookie values.

Cookie reset is typically used when multiple parallel authentication mechanisms are in play with the web agent and another authentication system. The agent can reset the cookies set by the other mechanism before redirecting the client to a login page.

To configure cookie reset, set Enable Cookie Reset to true and add each cookie to the Cookie Reset List. When enabled, the agent sends a Set-Cookie header to expire the listed cookies before redirecting the client for authentication.

If the cookies are secure, also set Enable Cookie Security to true.

To reset HttpOnly cookies, ensure Enable HTTP Only Mode is set to true (default).

If you enable attribute fetching using cookies to retrieve user data, you should also configure cookie reset. This ensures cookies are reset when an enforced URL is accessed without a valid session.