---
title: Cookies
description: Configure PingAM Web Agent SSO token cookie name, the pre-authentication session cookie, and cookie reset to clear cookies before redirecting clients to the login page.
component: web-agents
version: 2026
page_id: web-agents:user-guide:cookies
canonical_url: https://docs.pingidentity.com/web-agents/2026/user-guide/cookies.html
llms_txt: https://docs.pingidentity.com/web-agents/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2026-11-11T16:09:26Z
page_aliases: ["cookie-reset.adoc"]
section_ids:
  sso-cookie-name: SSO token cookie name
  change_the_sso_token_cookie_name_for_an_agent: Change the SSO token cookie name for an agent
  change_the_sso_token_cookie_name_for_an_agent_group: Change the SSO token cookie name for an agent group
  pre-authentication-session-cookie: Pre-authentication session cookie
  cookie-reset: Cookie reset
---

# Cookies

|   |                                                                                                           |
| - | --------------------------------------------------------------------------------------------------------- |
|   | Learn more about securing your cookies in [Manage cookies](../security-guide/access.html#manage-cookies). |

## SSO token cookie name

By default, the agent's single sign-on (SSO) token [cookie name](../properties-reference/com.sun.identity.agents.config.cookie.name.html) is `iPlanetDirectoryPro`.

Unless you use [Accept SSO Token](../properties-reference/com.forgerock.agents.accept.sso.token.html) mode or have enabled [Custom Login Mode](../properties-reference/org.forgerock.openam.agents.config.allow.custom.login.html), 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.

### Change the SSO token cookie name for an agent

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.

### Change the SSO token cookie name for an agent group

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.

## Pre-authentication session cookie

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](../properties-reference/com.sun.identity.cookie.httponly.html), [cookie security](../properties-reference/com.sun.identity.agents.config.cookie.secure.html), and [SameSite](../properties-reference/com.forgerock.agents.cdsso.cookie.samesite.html) 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.

## Cookie reset

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](../properties-reference/com.sun.identity.agents.config.cookie.reset.enable.html) to `true` and add each cookie to the [Cookie Reset List](../properties-reference/com.sun.identity.agents.config.cookie.reset.html). 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](../properties-reference/com.sun.identity.agents.config.cookie.secure.html) to `true`.

To reset HttpOnly cookies, ensure [Enable HTTP Only Mode](../properties-reference/com.sun.identity.cookie.httponly.html) is set to `true` (default).

|   |                                                                                                                                                                                                                                      |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|   | If you enable [attribute fetching](fetch-user-attributes.html) 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. |
