This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Getting a value from a cookie (Topic Closed Topic Closed)
Author
Message |
Will
Newbie


Joined: 15 June 2007
Location: United States
Posts: 2
Posted: 15 June 2007 at 10:29am  

Is there a way to get the value of a cookie so that i can use that value and add it to the end of a rewrite statement?

Example:

The cookie has a value of: session=(1234567)

RewriteRule /dir/page.htm /dir/page.htm?_SID=(1234567)

Thanks in advance for your help, and for releasing a great piece of software

Back to Top
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 16 June 2007 at 12:43pm  

RewriteCond Cookie: .*session=(\(\d+\)).*
RewriteRule /dir/mypage\.htm /dir/page.htm\?_SID=$1 [I,L]
Back to Top
 
Will
Newbie


Joined: 15 June 2007
Location: United States
Posts: 2
Posted: 19 June 2007 at 2:18pm  

Thnx for the reply, but the rule never seems to get executed. I believe that the cookie is ok, because if I change the RewriteCond line then the rule tries to run.

Current Rule:

RewriteCond Cookie: .*session=(\(\w+\)).*
RewriteRule (/intranet/.*) https\://server/intranet/page.jsp\?_SID=$1&destURL=$2 [I,R]

When I change it to :

RewriteCond Cookie: .*session=.*

Then the rule tries to run, but of course I don't get the session info i'm looking for.

Thnx again!

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 20 June 2007 at 4:08am  

Try this:

RewriteCond %HTTPS off
RewriteCond Cookie: .*session=(\(\w+\)).*
RewriteRule (/intranet/.*) https\://server/intranet/page.jsp\?_SID=$1&destURL=$2 [I,R]


__________________
Regards,
Anton
Back to Top
 

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

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum