# How are cookies used in operations

**URL:** <https://forum.keycloak.org/t/how-are-cookies-used-in-operations/4098>\
**Category:** Getting advice\
**Created:** [August 4, 2020, 1:08am UTC](https://forum.keycloak.org/t/how-are-cookies-used-in-operations/4098 "2020-08-04T01:08:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atsushi](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@atsushi](https://forum.keycloak.org/u/atsushi)\
**Post date:** [August 4, 2020, 1:08am UTC](https://forum.keycloak.org/t/how-are-cookies-used-in-operations/4098/1 "2020-08-04T01:08:27Z")

</div>

Continuing the discussion from [Keycloak 9.0.0 - Cookies are not being sent with SameSite=None by the server](http://forum.keycloak.org/t/keycloak-9-0-0-cookies-are-not-being-sent-with-samesite-none-by-the-server/4040):

I have a question about Keycloak’s cookies.  
What kind of processing is done with the KEYCLOAK\_IDENTITY and KEYCLOAK\_SESSION cookies published by Keycloak?  
I’m thinking of renaming these cookies so that Keycloak can’t use them.  
I want to ignore Keycloak’s cookies because I want to give priority to the Apache session.

I am trying to use Keycloak and Apache (mod\_auth\_openidc) to authenticate users from the browser.  
When someone log out, the session managed by Apache and the session managed by Keycloak are deleted.  
When logging out, if the session managed by Apache is enabled and the session managed by Keycloak is disabled, Keycloak will cause a server error and will not redirect to the logout screen.

I am thinking of renaming Keycloak\_IDENTITY and Keycloak\_SESSION cookies published by Keycloak in Apache.  
If I rename KEYCLOAK\_IDENTITY and KEYCLOAK\_SESSION and make them unavailable to Keycloak, I will not get a server error in Keyclawok when I log out.  
How are KEYCLOAK\_IDENTITY and KEYCLOAK\_SESSION used in operations other than this logout?

Server error in Keycloak.  
Uncaught server error: java.lang.IllegalStateException: Can’t add session: task in progress for session

Apache setting to rename Keycloak’s cookies.  
Header edit Set-Cookie KEYCLOAK\_SESSION\_LEGACY KEYCLOAK\_SESSION\_LEGACY\_DUMMY  
Header edit Set-Cookie KEYCLOAK\_IDENTITY\_LEGACY KEYCLOAK\_IDENTITY\_LEGACY\_DUMMY

Thank you
