cancel
Showing results for 
Search instead for 
Did you mean: 

Rewrite single cookie "USERCOOKIE" domain if cookie domain is "www1.test,example.com"

RajaG
Nimbostratus
Nimbostratus

in General browser request have multiple cookies We just wanted to  rewrite single cookie "USERCOOKIE" domain if cookie domain is "www1.test,example.com" change it to ".test,example.com".

if customer http request don't have cookie name "USERCOOKIE", F5 no need to modify Cookie domain in HTTP_RESPONSE.

when HTTP_RESPONSE {
HTTP::cookie domain "USERCOOKIE" ".test,example.com"
}

Thank you.

2 ACCEPTED SOLUTIONS

JRahm
Community Manager
Community Manager

Something like this should work:

 

when HTTP_RESPONSE {
  if { [HTTP::cookie exists "USERCOOKIE"] } {
    HTTP::cookie domain "USERCOOKIE" ".[domain [HTTP::cookie domain "USERCOOKIE" 3]]"
  }
}

 

 

View solution in original post

Leslie_Hubertus
Community Manager
Community Manager

Hi @RajaG  - did Jason's solution work for you? If yes, can you please mark it as an Accepted Solution, and that way any user having the same problem can quickly find the answer later (and Jason gets a cookie).  🙂

If no - let's keep the thread going. 

View solution in original post

2 REPLIES 2

JRahm
Community Manager
Community Manager

Something like this should work:

 

when HTTP_RESPONSE {
  if { [HTTP::cookie exists "USERCOOKIE"] } {
    HTTP::cookie domain "USERCOOKIE" ".[domain [HTTP::cookie domain "USERCOOKIE" 3]]"
  }
}

 

 

Leslie_Hubertus
Community Manager
Community Manager

Hi @RajaG  - did Jason's solution work for you? If yes, can you please mark it as an Accepted Solution, and that way any user having the same problem can quickly find the answer later (and Jason gets a cookie).  🙂

If no - let's keep the thread going.