Forum Discussion
2 Replies
Sort By
- Greg_Ryan_33844NimbostratusGuess I am only concerned with the last ';'. Is this the standard way a cookie is set? If I do a curl on yahoo or google or any other site I don't see a ';' at the end of the string. Only with my f5.
- hooleylistCirrostratusHi Greg,
when HTTP_RESPONSE { Insert some test headers with trailing semi-colons HTTP::header insert "Set-Cookie" "cookie1=value1; path=/1; domain=.1.example.com;" HTTP::header insert "Set-Cookie" "cookie2=value2; path=/2; domain=.2.example.com;" Save the Set-Cookie headers to a TCL list set cookie_headers [HTTP::header values "Set-Cookie"] Remove all of the Set-Cookie headers HTTP::header remove Set-Cookie Loop through the list of Set-Cookie headers foreach cookie_header $cookie_headers { Check if the last character is a semi-colon if {[string range $cookie_header end end] eq ";"}{ Insert the header without the semi-colon HTTP::header insert Set-Cookie [string range $cookie_header 0 end-1] } else { Insert the original header HTTP::header insert Set-Cookie $cookie_header } } }