Forum Discussion
IheartF5_45022
Oct 02, 2015Nacreous
So normally the cookie is inserted in only 1 response - you need the cookie inserted in every response so that it always expires in 60min. Let me know if this works;-
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
“/example*”
{
pool VIPNAME1-POOLNAME
}
“/sample*”
{
pool pool VIPNAME-POOLNAME
}
}
persist cookie insert cookie "0d 00:60:00"
set cname "BIGipServer[LB::server pool]"
if {[HTTP::cookie exists "BIGipServer[LB::server pool]"} {
Save the current cookie value
set cvalue [HTTP::cookie $cname]
}
}
when HTTP_RESPONSE {
if {![HTTP::cookie exists $cname]} {
If there is no cookie in this response already, insert one
HTTP::header insert Set-Cookie "$cname=$cvalue; Path=/; Max-Age=3600; HttpOnly
}
}