---
title: Session cache eviction with PingAM
description: Configure PingGateway to receive WebSocket notifications from PingAM and evict session cache entries on sign-out or session expiry
component: pinggateway
version: 2026
page_id: pinggateway:gateway-guide:session-eviction
canonical_url: https://docs.pingidentity.com/pinggateway/2026/gateway-guide/session-eviction.html
revdate: 2025-04-01T17:53:34Z
---

# Session cache eviction with PingAM

When WebSocket notifications are enabled in PingGateway, PingGateway receives notifications when the following events occur:

* A user logs out of AM

* An AM session is modified, closed, or times out

* An AM admin forces logout of user sessions (from AM 7.3)

The following procedure gives an example of how to change the configurations in [Single sign-on with PingAM](sso.html) and [Cross-domain single sign-on for PingAM](cdsso.html) to receive WebSocket notifications for session logout and to evict entries related to the session from the cache. For information about WebSocket notifications, refer to [WebSocket notifications](../maintenance-guide/tuning.html#amservice-websocket).

Before you start, set up and test the example in [Single sign-on with PingAM](sso.html).

1. Websocket notifications are enabled by default. If they are disabled, enable them by adding the following configuration to the [AmService](../reference/AmService.html) in your route:

   ```json
   "notifications": {
     "enabled": true
   }
   ```

2. Enable the session cache by adding the following configuration to the [AmService](../reference/AmService.html) in your route:

   ```json
   "sessionCache": {
     "enabled": true
   }
   ```

3. In `logback.xml` add the following logger for WebSocket notifications, and then restart PingGateway:

   ```xml
   <logger name="org.forgerock.openig.tools.notifications.ws" level="TRACE" />
   ```

   For information, refer to [Changing the log level for different object types](../maintenance-guide/logging.html#logging-level-objects).

4. On the AM console, log the demo user out of AM to end the AM session.

5. Note that the PingGateway system logs are updated with Websocket notifications about the logout:

   ```none
   ... | TRACE | vert.x-eventloop-thread-4 | o.f.o.t.n.w.l.DirectAmLink | @system | Received a message: { "topic": ... "eventType": "LOGOUT" } }
   ... | TRACE | vert.x-eventloop-thread-4 | o.f.o.t.n.w.SubscriptionService | @system | Notification received... "eventType": "LOGOUT" }}
   ... | TRACE | vert.x-eventloop-thread-4 | o.f.o.t.n.w.SubscriptionService | @system | Notification sent to a [/agent/session.v2] listener
   ```
