can route rules use conditionals based on request cookies?

ccovney
Participant V

Hi everyone,

Does anyone know if a route rule can use conditionals based on request cookies? I know it can use conditionals based on request query params and headers, but what about request cookies?

My aim was to route traffic with certain cookie values to certain targets. Any help or info would be very much appreciated!

I'm running Apigee Edge Private Cloud version 4.15.04-ws.

Best, Chris

1 3 762
3 REPLIES 3

you could extract cookie into a flow variable may be using JS policy and extract variables, then use that flow variable in your conditions for routerules. The only reason to use another policy is, you might want to extract certain cookie from a set of cookies present in the header

All flow variables [not just queries and headers] can be used in the conditions

Former Community Member
Not applicable

@Chris Covney here is a link to the Apigee JavaScript object model for some additional details. AS @mukundha@apigee.com suggested you can use a JavaScript policy to extract the cookie information & set a flow variable that can be used in your route rules.

ccovney
Participant V

Thanks @Prithpal Bhogill and @mukundha@apigee.com for the helpful comments. It looks like my project can be designed as planned.

Thanks again, Chris