iRule Cookie Rewrite Domain w/ Subdomain

Hi all,

We have a requirement whereby we need to ensure that a sub-domain on a cookie domain persists all the way to one of our back-end Oracle servers (Oracle requires a sub-domain). The cookie is written to the browser with the domain “qa-my.bar.com”, however on the requests set to the back-end server, I need to ensure that the domain is “qa-foo.bar.com”. It seems that you can’t do this in an iRule because setting the domain property of the cookie to “qa-foo.bar.com” fails because the iRule won’t let you set the sub-domain - setting the domain to “.bar.com” works.

Is this even possible? If so, any recommendations on how to do this?

Hello Tom,

The domain attribute is normally set in the response set-cookie header, not in the request. Base on the domain attribute set by the back-end in the response, the browser will (or will not) send that cookie in subsequent requests.