Forum Discussion
Adding httponyle and secure attributes a ustom cookie persistence profile
Hi,
Customer was asking if it would be possible to add httponly and secure attributes to their Virtual Server specific cookie based persistence profile for example i have cookie profile for customer1 and there is cookie name customer_cookie.
How could I add those attributes to the customer_cookie with an iRule.
Thanks in advance
Teemu
4 Replies
- Teemu_Kunnari_1
Nimbostratus
Hi Kai,
Thanks for reply but I can't find those options. We use 11.6.0. What version are you running ?
Any idea to make that same outcome with an iRule?
Thanks,
Teemu
Hi Teemu,
you're right, the build in support for HttpOnly and Secure flags is somewhat new (v12+ feature). To have the same functionality for older versions, you may want to use the iRule below...
when HTTP_RESPONSE { foreach cookie [HTTP::cookie names] { if { $cookie starts_with "BIGipServer" } { HTTP::cookie version $cookie 1 HTTP::cookie secure $cookie enable HTTP::cookie httponly $cookie enable } } }Note: You have to change the
line, if you're using a non-default cookie name.$cookie starts_with "BIGipServer"Cheers, Kai
- Teemu_Kunnari_1
Nimbostratus
Hi Kai and thanks again !
One more thing about this. Should I apply this only to HTTPS VS if we use HTTP to HTTPS redirect iRule in the HTTP VS ?
Thanks in advance for your big help! :)
Teemu
- Hi Teemu, you're welcome! ;-) If you're going to redirect everything from HTTP to HTTPS, then you don't need to use a default pool, persistence profile and cookie rewrite iRule for the HTTP Virutal Server. Cheers, Kai
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