As to my research the header passing is already containing the changed cookie (as cookies are part of the header) so the second setting of the cookie becomes unnecessary.
Avoid stripping away cookie data and hence avoid having problems with Cookie Based Authentication Proxies
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>