This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: cookie format
Author
Message |
Grimace
Newbie


Joined: 25 September 2007
Posts: 6
Posted: 21 January 2010 at 3:13am

I'm trying to set a cookie through isapi rewrite, but there are some mismatches against setting a cookie from ASP.NET:

When doing this:

RewriteCond %{HTTP:Host} ((.+\.)*domain.de)
RewriteCond %{HTTP_COOKIE} !culture [NC]
RewriteRule ^.*$ - [CO=Culture:de-DE:%1:7200]

My cookie in Firebug looks like this (note the casing and the domain dots):

Name: culture
Value: de-de
Domain: .domain.de

While cookies set with ASP.NET look like this:

Name: Culture
Value: de-DE
Domain: domain.de

Is there a way to have IsapiRewrite retain the casing and remove the leading dot from the domain?
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 21 January 2010 at 7:57am

Please try to fix the rules like this (it should solve the issue with unnecessary dot):

RewriteCond %{HTTP:Host} ^((?:[^.]+\.)?domain.de)$ [NC]
RewriteCond %{HTTP_COOKIE} !culture [NC]
RewriteRule ^.*$ - [CO=Culture:de-DE:%1:7200]

And as for the lowercasing of cookie value, we'll fix this behavior in the next build. Is that critical?

__________________
Regards,
Anton
Back to Top
 
Grimace
Newbie


Joined: 25 September 2007
Posts: 6
Posted: 22 January 2010 at 5:15am

Luckily, I'm the one programming the site that suffers from this, so for the moment, it's not that critical.

But even if you get the casing problem solved, I tried your solution for the dot to no avail. Even if I literally put the domain name in the cookie, it gets prefixed with a dot.

e.g.:

  RewriteRule ^.*$ - [CO=Culture:de-DE:domain.de:7200]

gives in Firebug:

  Name: culture
  Value: de-de
  Domain: .domain.de
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 22 January 2010 at 9:02am

We've tested the rule above in out testing environment and we don't get this dot at the beginning.
Please try to restart IIS and show the complete ISAPI_Rewrite config you use.

__________________
Regards,
Anton
Back to Top
 
aiken_sc
Newbie


Joined: 03 July 2012
Posts: 1
Posted: 03 July 2012 at 12:26pm

I know this is an old topic but was there ever a solution? We are having the same issue here. We are using the exact rule that was suggested.

IIS 6 / Windows 2003
Back to Top
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 04 July 2012 at 5:40am

Please, create a new topic and describe your issue with example and the logs.

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version