Score:0

Intercept cookie with NGINX from upstream response and create a new cookie

in flag

In order to synchronize two web applications, I need to intercept KEYCLOAK_SESSION cookie with NGINX from upstream response - sso.example.com and if such cookie is present, create another cookie SID (copy of KEYCLOAK_SESSION ) but for .example.com domain.

Is it possible with NGINX and if so, could you please show NGINX configuration for this?

djdomi avatar
za flag
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
alexanoid avatar
in flag
When the response from the upstream to NGINX contains the KEYCLOAK_SESSION cookie, I need to create a brand new cookie with the name SID. This new cookie should have the same max-age as the KEYCLOAK_SESSION cookie but a different domain.
alexanoid avatar
in flag
Also, the value in the SID cookie may be just a simple '1'.
alexanoid avatar
in flag
I'm going to use the SID cookie as a flag for my application to determine whether there is an active Single Sign-On session. I don't want to use this cookie as the session itself; it's merely a flag to trigger additional application-specific actions.
djdomi avatar
za flag
please update the question and details, if you want have a clue like [ask] clean up the commentary after updating the question
alexanoid avatar
in flag
Thanks :) It seems like StackExchange is becoming increasingly less useful
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.