简体   繁体   中英

Tuckey urlrewrite check if cookie is set

I am trying to check if given cookie exists with given tag in urlrewrite.xml:

<condition type="cookie" name="LANGUAGE" operator="notequals"></condition>

but it seams not to work.

Any ideas?

What I had to do is first check for the existence of the parameter|cookie and then compare to the value I wanted...

<rule>
    <condition type="parameter" name="theme" operator="equal">^.+$</condition>
    <condition type="parameter" name="theme" operator="notequal">^default$</condition>
    <set name="themeheader">Theme is %{parameter:theme}</set>
</rule>

Replace type above with cookie and change the name of the cookie you want to find and you should be able to use this. I have tested this and I'm now using this on my server so I know it does what I'd expect.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM