# Cookie Token Store How To

**URL:** <https://forum.keycloak.org/t/cookie-token-store-how-to/1572>\
**Category:** Getting advice\
**Tags:** adapter-java, authentication, oidc\
**Created:** [March 6, 2020, 10:03am UTC](https://forum.keycloak.org/t/cookie-token-store-how-to/1572 "2020-03-06T10:03:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyReynard](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@JeremyReynard](https://forum.keycloak.org/u/JeremyReynard)\
**Post date:** [March 6, 2020, 10:03am UTC](https://forum.keycloak.org/t/cookie-token-store-how-to/1572/1 "2020-03-06T10:03:38Z")

</div>

Hello guys,

We’ve recently upgraded to Keycloak 9.0.0 in order to use the Cookie Token Store in the Spring Boot Adapter.

For the moment, we only set the parameter “keycloak.token-store=COOKIE” for the adapter.

We were looking for some documentation about how to use it correctly.

We have two use cases:

1. Users authentication to our webapp (using Keycloak of course) in a browser

2. Users authentication to our REST API (using Keycloak of course) via HTTP requests

For 1), we would like to use a standard authentication flow (access\_token, refresh\_token in HTTP session).

For 2), we would like to use the “Token Store Cookie mode” and exchange the authentication information via the “KEYCLOAK\_ADAPTER\_STATE” cookie.

We read the Spring Boot Keycloak filters and other Spring Boot adapter classes just to know how the KEYCLOAK\_ADAPTER\_STATE is managed, but we cannot find how to get this cookie :’(

Could you please give us some example, documentation,…?

Thanks a lot for your help!
