Forum Discussion
iRule to rewrite Cookie path
Hi, any idea how I can use an iRule to rewrite a cookie path from the server response? I need to rewrite the set-cookie path in the response from path=/abc to path=/
Thanks in advance.
Regards,
Brian
- PK_BhatiaNimbostratus
May be this is what you are looking for:
https://devcentral.f5.com/wiki/iRules.ProxyPassV10.ashx
- BrianG99_140859Nimbostratus
Hi PK, yes I looked at the proxypassV10 irule but couldn't figure out what I need to do to make it work for the cookie path. I tried using the data group but that doesn't change the cookie path for me.
Brian
- Alscion_68122Nimbostratus
Hi,
Here is an irule to rewrite cookie path. You can use the path you want instead of MyCustomPath
when HTTP_RESPONSE { set cookies [HTTP::cookie names] foreach cookie $cookies { set cookie_value [HTTP::cookie $cookie] set cookie_path "/MyCustomPass" HTTP::cookie remove $cookie HTTP::cookie insert name $cookie value $cookie_value path $cookie_path } }
BR.
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