Configuring the PingFederate cookie
PingFederate uses the PingFederate cookie to identify sessions. Some adapters, such as the HTML Form Adapter, also use this cookie to manage adapter sessions. Use this task to configure PingFederate cookie settings in session-cookie-config.xml, including the cookie name, length, security flags, domain, and lifetime.
Steps
-
In a text editor, open the
<pf_install>/pingfederate/server/default/data/config-store/session-cookie-config.xmlfile. -
Modify the appropriate parameter in
session-cookie-config.xml. Refer to the PingFederate cookie parameters table for parameter information.(Optional) Alternatively, you can update a cookie parameter using a REST call to the PingFederate administrative API. For example:
curl -u <username:password> -X 'PUT' \ 'https://<PF_host>/pf-admin-api/v1/configStore/session-cookie-config/cookie-domain' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'X-XSRF-Header: PingFederate' \ -d '{"id":"cookie-domain","type":"STRING","stringValue":".example.com"}'To update another parameter, use the same request pattern and replace the parameter name and value. Learn more in Accessing the API interactive documentation.
-
If you updated the file directly, save and close the file.
-
Restart PingFederate.
-
For a clustered PingFederate environment, perform these steps on the console node. Then, click Replicate Configuration on System > Server > Cluster Management.
Result
After you restart PingFederate, the Set-Cookie HTTP header reflects your changes. For example, if you configure cookie-domain, cookie-secure-flag, and cookie-httponly-flag, the header can look like this:
Set-Cookie: PF=aDfPx6uwbbWGFhwE6zEhEG;Path=/;Domain=.example.com;Secure;HttpOnly
|
For browser restart support without a persistent PingFederate cookie, configure externally stored authentication sessions instead. Learn more in Sessions. |
PingFederate cookie parameters
The session-cookie-config.xml file contains the following parameters to configure the PingFederate cookie:
| Parameter | Description |
|---|---|
|
Sets the name of the PingFederate cookie. The default value is The configured name displays in the |
|
Sets the length of each generated PingFederate session ID value. The default value is |
|
Controls whether PingFederate marks the cookie as When enabled, browsers send the cookie only over HTTPS connections. |
|
Controls whether PingFederate marks the cookie as When enabled, client-side scripts can’t access the cookie. |
|
Adds domain information to the When set, PingFederate includes the Example configuration: |
|
Defines the cookie lifetime in seconds. The default value, |