databasesessionkeycloakh2dbusersession

Empty SESSION Table in Keycloak H2 Database


I'm using Keycloak 15.0.2 with the default H2 database. I have logged in several users and can get active session in the Keycloak session tab, but in DB, I cannot see any entries in all tables related to sessions like USER_SESSION and CLIENT_SESSION.

Does anyone have any suggestion that how can I get these entries?

Thanks in advance.


Solution

  • Keycloak does not store sessions in the database, except for offline sessions. Sessions are stored in-memory in Infinispan caches. You can use the REST API to access sessions.