Forum Discussion
amebiz_142234
Jun 06, 2018Nimbostratus
there is a way to add a cookie in a redirect. also a cool way to handle that
when_HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/foo/" } {
set cookie [format "%s=%s; path=/; domain=%s" "cookie" "foo" ".foobar.com"]
HTTP::respond 301 Location "/foo" "Set-Cookie" $cookie
}
if { [string tolower [HTTP::uri]] equals "/bar/" } {
set cookie [format "%s=%s; path=/; domain=%s" "cookie" "bar" ".foobar.com"]
HTTP::respond 301 Location "/bar" "Set-Cookie" $cookie
}
}