Apache mod_headers: can't edit set-cookie header Apache mod_headers: can't edit set-cookie header apache apache

Apache mod_headers: can't edit set-cookie header


One has to add always before edit

Header always edit "Set-Cookie" "Domain=internal.example.com" "Domain=example.com"

For my instance, I used edit* as well (replaces all occurrences)


Adding to Misko's response (because my account is too new to comment) the Apache docs say that the response headers come out of TWO sets of internal tables. Thus "always" is required for some things to work, and an absence of "always" is required for others to work. In my case, Ubuntu 18.04, Apache 2.4.29 I had to remove "always" for the headers to be edited coming out of PHP 7.2.

The docs seem to suggest you can have both directives to cover all bases but I have not tested that.