You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ben Spencer <be...@moody.edu> on 2008/03/04 16:03:35 UTC

[users@httpd] mod_rewrite, cookies and : in the value

Configuration: 2 servers which use two different cookies to help maintain
sessions. The cookies are set domain wide so each server can actually update
the others cookies.

When a request is sent to either server, I want to be able to update the
others cookies (session timeout time) with mod_rewrite due to an application
limitation (which allows these to get out of sync).

This is a simple task, except that the value of the cookie actually has a
":" in it which confuses mod_rewrite and the parameters since the parameter
separator is a ":".

Example:
RewriteCond %{HTTP_COOKIE} "CookieName=(.*);"
RewriteRule ^/ - [CO=CookieName:%1:domain.com:20:/,C]

With the value of %1 being "list: someData|OtherData "

Mod_rewrite takes this to be:
RewriteRule ^/ - [CO=CookieName:list:someData|OtherData:domain.com:20:/,C]

...which just throws things off :) Does anyone have a trick which would
allow a ":" to be in the data of a cookie when set?

thanks
benji
---
Benji Spencer
System Administrator
Ph: 312-329-2288


RE: [users@httpd] mod_rewrite, cookies and : in the value

Posted by Ben Spencer <be...@moody.edu>.
> > This is a simple task, except that the value of the cookie actually has
> > a ":" in it which confuses mod_rewrite and the parameters since the
> > parameter separator is a ":".
> 
> You just need to escape the colon as "%3A" (percentage-three-uppercase A).

Hmmm....Thanks. How to do that in the apache configuration?

Thanks


Re: [users@httpd] mod_rewrite, cookies and : in the value

Posted by Daniel Aleksandersen <al...@runbox.com>.
On 2008-03-04, Ben Spencer wrote:
> This is a simple task, except that the value of the cookie actually has
> a ":" in it which confuses mod_rewrite and the parameters since the
> parameter separator is a ":".

You just need to escape the colon as “%3A” (percentage-three-uppercase A).
-- 
Daniel’s linux notebook – http://www.opensource-notebook.com/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org