How to add a cookie value to complete a response. Location header with Apache?

I have a page that issues an HTTP redirect. I need to add the current session identifier (jsessionid) at the end of the HTTP redirect to pass that identifier as a GET parameter in the redirect.

Can mod_header Header appendset cookie value through SetEnvIf?

Should I correspond sooner? But mod_rewritejust rewriting the request is not the answer, right?

How do you solve this from the point of view of Apache without touching the internal code?


Update: Apache-JVM is being processed either by mod_jk OR through an IBM HTTP Server connection with WebSphere.

+3
source share
1

, Apache HTTPd :

SetEnvIf Cookie "mycookie=([^;]+)" MYCOOKIE=$1
SetEnvIf Cookie "mycookie=([^;]+)" HAVE_MYCOOKIE=1
Header add Set-Cookie "mycookie=%{MYCOOKIE}e; expires=0" env=HAVE_MYCOOKIE

cookie, , .

+7

Source: https://habr.com/ru/post/1768313/


All Articles