Forum Discussion
Could someone explain how to create a cookie via irule?
I've got a pre-existing irule that checks whether the value of an individual cookie equals a given value, and then sends it on to a particular server. So I've got this line I'd like to put earlier in the rule.
http::cookie insert value targetCookie "" path / domain ".abc.com"
The latter line, which was already existing is as follows.
elseif {([http::cookie value "targetCookie" ] equals "" ) } { node }
This seems simple enough, but I'm scratching my head as to the relationship between "targetCookie" and its value and whether I got the syntax correct.
I'd also like to know whether for the domain parameter, does ".abc.com" need quotes or not.
1 Reply
- samstep
Cirrocumulus
It looks to me you are confusing the cookie Name with a cookie Value. Your pre-existing line of code checks if a cookie with a Name "targetCookie" has Value "" and if yes then send the traffic to the backend node (server) with specific IP address.
The line you are trying to wrong because the cookie name should be "targetCookie" and value should be the server name.
You should be putting all string parameters in double quotes.
HTTP::cookie command documentation is available here:
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com