Chapter 12 Load Balancing for FortiOS 5.0 : Configuring load balancing : HTTP and HTTPS load balancing, multiplexing, and persistence : HTTP and HTTPS persistence
  
HTTP and HTTPS persistence
Configure load balancing persistence for HTTP or HTTPS to make sure that a user is connected to the same server every time they make a request that is part of the same session. HTTP cookie persistence uses injected cookies to enable persistence.
When you configure persistence, the FortiGate unit load balances a new session to a real server according to the Load Balance Method. If the session has an HTTP cookie or an SSL session ID, the FortiGate unit sends all subsequent sessions with the same HTTP cookie or SSL session ID to the same real server.
The following example shows how to enable cookie persistence and set the cookie domain to .example.org.
config firewall vip
edit HTTP_Load_Balance
set type server-load-balance
set server-type http
set extport 8080
set extintf port2
set extip 192.168.20.20
set persistence http-cookie
set http-cookie-domain .example.org
config realservers
edit 1
set ip 10.10.10.1
set port 80
next
edit 2
set ip 10.10.10.2
set port 80
next
edit 3
set ip 10.10.10.3
set port 80
end
end