Web Servers on Unix and Linux - Apache seach and replace Response Header

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > April 2005 > Apache seach and replace Response Header





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache seach and replace Response Header
Manuel Blechschmidt

2005-04-19, 5:54 pm

Hello Group,
I want to change a cookie path which is created by a cgi script. The
script is encoded and I cant change it. The URL in which way the script
is opened is rewritten, so the cookie path is wrong.
I just want to change the cookie path but I could not find how to read
from the header.
I need the environment Variable for response cookies.
I could also write a little hack for mod_headers to do this little task
but a default way would be better.


SetEnvIf Cookies ".*SessionID=(.*)" SessionID=$1
^^^^^ This only works with RequestHeaders
Header set Set-Cookie "SessionID=%{SessionID}e; Version=1; Path=/"
Header append Set-Cookie "Currency=EUR; Version=1; Path=/"

Greetings
Manuel
Manuel Blechschmidt

2005-04-20, 5:49 pm

Manuel Blechschmidt wrote:
> Hello Group,
> I want to change a cookie path which is created by a cgi script. The
> script is encoded and I cant change it. The URL in which way the script
> is opened is rewritten, so the cookie path is wrong.
> I just want to change the cookie path but I could not find how to read
> from the header.
> I need the environment Variable for response cookies.
> I could also write a little hack for mod_headers to do this little task
> but a default way would be better.


I solved the problem by hacking the mod_headers script.

>
>
> SetEnvIf Cookies ".*SessionID=(.*)" SessionID=$1
> ^^^^^ This only works with RequestHeaders
> Header set Set-Cookie "SessionID=%{SessionID}e; Version=1; Path=/"
> Header append Set-Cookie "Currency=EUR; Version=1; Path=/"
>
> Greetings
> Manuel

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com