Forum Discussion
DaveC_53879
Nimbostratus
May 06, 2011cookie persistence sendfor: http only
Need help with cookie persistence. LTM version 9.4.6. How do I set the F5 cookie to http only?
nitass
Employee
Oct 15, 2011Hi DaveC,
[root@iris:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.17.33:http
ip protocol tcp
persist mycookie
profiles {
myhttp {}
tcp {}
}
}
[root@iris:Active] config b profile mycookie list
profile persist mycookie {
defaults from cookie
mode cookie
timeout 180
cookie mode insert
cookie name "cookie_20"
}
[root@iris:Active] config b profile myhttp list
profile http myhttp {
defaults from http
cookie secret "secret"
encrypt cookies "cookie_20"
}
[root@iris:Active] config curl -I http://172.28.17.33
HTTP/1.1 200 OK
Date: Sat, 15 Oct 2011 01:29:40 GMT
Server: Apache/2.0.59 (rPath)
Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT
ETag: "667a-67-cfb682c0"
Accept-Ranges: bytes
Content-Length: 103
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Set-Cookie: cookie_20=DtUT7p97+feyDIKi2OCuEWPqv0KMJRGoC16eEnwbcXGkonYaZHplZ51iBCel9egDDSZfSZ3TfeACgWg=; path=/
[root@iris:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
if {[HTTP::cookie "cookie_20"] ne ""}{
HTTP::header replace Set-Cookie "[HTTP::header Set-Cookie]; HttpOnly"
}
}
}
[root@iris:Active] config b virtual bar rule myrule
[root@iris:Active] config curl -I http://172.28.17.33
HTTP/1.1 200 OK
Date: Sat, 15 Oct 2011 01:30:02 GMT
Server: Apache/2.0.59 (rPath)
Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT
ETag: "667a-67-cfb682c0"
Accept-Ranges: bytes
Content-Length: 103
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Set-Cookie: cookie_20=BUuoH166ZBENSFCi2OCuEWPqv0KMJfEr2qRf+Svnu9S1feGWc/rkeJ1u1sm5yjRjoXdxLF6A8rvG0N4=; path=/; HttpOnly
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects