'Springboot oauth2 how to disable JSESSIONID cookie

I'm using spring-boot-starter-oauth2-client, it works great for the "Authorization Code Flow". However, it seems after the callback/redirect, spring will use the JSESSIONID in the cookie to manage the authenticated user. I have trouble finding how to disable the behavior and I'd like to set the access_token directly in the cookie.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source