Andrea_Arquint
Oct 20, 2010Nimbostratus
cookie insertion
Hi
How can I set a cookie in the clients browser if he makes a request to a specific /folder/ ???
thanx
bb
http://devcentral.f5.com/wiki/default.aspx/iRules.HTTP
Here's a list of all the commands.
http://devcentral.f5.com/wiki/default.aspx/iRules.Commands
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/folder" } {
HTTP::cookie insert "name" value "value" } }
That rule will insert a cookie named "name" with a value of "value" whenever the URI requested contains "/folder" You might want to replace "contains" with "starts_with" depending on your requirements. You'll also want to add an expiration or path if you need it.
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__cookie.html shows all the options.
Let me know if you have any other questions.