Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove cookies based on hostname from http response.. possible?

David_M
Cirrostratus
Cirrostratus

So this is one of those single vs with multiple pools all done by irules but we are using cookie persistence profile on the vs.

Can we remove the extra cookies or maybe just leave the bigip cookie and remove the rest so we have equal LB?

We are using RR for LB and want to remove the cookies for only one particular hostname/domain.

The magenta cookie comes from our persistence profile, the other 2 I guess being from the servers?TO66sAB

 

 

3 REPLIES 3

enesik
Nimbostratus
Nimbostratus

After receiving an HTTP request, a server can send one or more Set-Cookie headers with the response. The browser usually stores the cookie and sends it with requests made to the same server inside a Cookie HTTP header. You can specify an expiration date or time period after which the cookie shouldn't be sent 

And You can't pass cookies in the URL. You can pass session ID if server supports it. Java Servlet containers do support it (it's in Servlet spec) by using jsessionid path parameter. Just make sure ;jsessionid=... is right after the path, before query (it's called "path parameter" for a reason)

enesik
Nimbostratus
Nimbostratus

After receiving an HTTP request, a server can send one or more Set-Cookie headers with the response. The browser usually stores the cookie and sends it with requests made to the same server inside a Cookie HTTP header. You can specify an expiration date or time period after which the cookie shouldn't be sent 

And You can't pass cookies in the URL. You can pass session ID if server supports it. Java Servlet containers do support it (it's in Servlet spec) by using jsessionid path parameter. Just make sure ;jsessionid=... is right after the path, before query (it's called "path parameter" for a reason)

 

MyMorri 

CA_Valli
MVP
MVP

Hello David, copy-pasting the response I gave you in the other thread (sorry, I thought I was responding on this thread already and answering here is much more appropriate). 

 

It's not clear to me what you're trying to achieve, if you just need to remove persistence cookie and always rely on pool LB selection method, there is "persist none" iRule instruction. 

If you need to remove all cookies (why?) you can use my iRule, keep in mind this will delete persistence cookie as well. If you need to keep persist cookie, you can set it manually in the iRule with " persist cookie insert my_cookie_name "0d 00:00:00" " instruction and/or write some additional lines to save it & restore it after "cleanup cycle" is performed.