Forum Discussion
nitass
Dec 20, 2011Employee
have you tried HTTP::header insert?
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
1 year = 31536000 seconds
set cookie_expire 31536000
set cookie_expire_date [clock format [expr [clock seconds] + $cookie_expire] -format "%a, %d-%b-%Y %H:%M:%S GMT" -gmt true]
set cookie_domain .test.domain.local
set cookie_name my_cookie
set cookie_value 12345
set cookie [format "%s=%s; path=/; domain=%s; expires=%s; HttpOnly" $cookie_name $cookie_value $cookie_domain $cookie_expire_date]
HTTP::header insert "Set-Cookie" $cookie
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79
HTTP/1.1 200 OK
Date: Tue, 20 Dec 2011 17:50:56 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Connection: close
Content-Type: text/html; charset=UTF-8
Set-Cookie: my_cookie=12345; path=/; domain=.test.domain.local; expires=Wed, 19-Dec-2012 17:50:42 GMT; HttpOnly