Chapter 12 Load Balancing for FortiOS 5.0 : Configuring load balancing : HTTP and HTTPS load balancing, multiplexing, and persistence : HTTP host-based load balancing : Host load balancing and HTTP cookie persistence
  
Host load balancing and HTTP cookie persistence
In an HTTP host-based load balancing configuration with HTTP cookie persistence enabled you can optionally configure cookie persistence to use the domain set in the host header as the cookie domain. You can do this by enabling the http‑cookie‑domain‑from‑host option, for example:
config firewall vip
edit "http-host-ldb"
set type server-load-balance
set extip 172.16.67.195
set extintf "lan"
set server-type http
set ldb-method http-host
set extport 80
set persistence http-cookie
set http-cookie-domain-from-host enable
config realservers
edit 1
set http-host "www.example1.com"
set ip 192.168.2.1
set port 80
next
edit 2
set http-host "www.example2.com"
set ip 192.168.2.2
set port 80
next
edit 3
set ip 192.168.2.3
set port 80
next
end
end