config : server-policy persistence-policy
 
server-policy persistence-policy
Use this command to configure a persistence method and timeout that you can apply to server pools. The persistence policy applies to all members of the server pool.
After FortiWeb has forwarded the first packet from a client to a pool member, some protocols require that subsequent packets also be forwarded to the same back-end server until a period of time passes or the client indicates that it has finished transmission.
To apply a persistence policy, select it when you configure a server pool. For details, see “config server-policy server-pool”.
To use this command, your administrator account’s access control profile must have either w or rw permission to the traroutegrp area. For more information, see “Permissions”.
Syntax
config server-policy persistence-policy
edit <persistence-policy_name>
set Persistence-type {ASP-SESSIONID | Insert-Cookie | JSP_SESSIONID | PHP-SESSIONID | Persistent-Cookie | Persistent-IP}
set cookie-name <cookie-name_str>
set persistence-timeout <persist-timeout_int>
next
end
Variable
Description
Default
<persistence-policy_name>
Type the name of the persistence policy. The maximum length is 63 characters.
To display the list of existing persistence policies, type:
edit ?
No default.
Persistence-type {ASP-SESSIONID | Insert-Cookie | JSP_SESSIONID | PHP-SESSIONID | Persistent-Cookie | Persistent-IP}
Type either:
ASP-SESSIONID — If a cookie in the initial request contains an ASP .NET session ID value, FortiWeb forwards subsequent requests with the same session ID value to the same pool member as the initial request. (FortiWeb preserves the original cookie name.)
Insert-Cookie — FortiWeb inserts a cookie with the name cookiesession2 to the inital request and forwards all subsequent requests with this cookie to the same pool member. FortiWeb uses this cookie for persistence only and does not forward it to the pool member.
JSP_SESSIONID — FortiWeb forwards subsequent requests with the same JSP session ID as the inital request to the same pool member. (FortiWeb preserves the original cookie name.)
PHP-SESSIONID — If a cookie in the initial request contains a PHP session ID value, FortiWeb forwards subsequent requests with the same session ID value to the same pool member as the initialrequest. (FortiWeb preserves the original cookie name.)
Persistent-Cookie — If an inital request contains a cookie whose name matches the Cookie Name value, FortiWeb forwards subsequent requests that contain the same cookie value to the same pool member as the intial request.
Persistent-IP — FortiWeb forwards subsequent requests with the same client IP address as the inital request to the same pool member.
Persistent-IP
cookie-name <cookie-name_str>
Type the name of the cookie to match in an initial request from a client.
If the cookie name in the initial request matches Persistence Cookie, FortiWeb forwards any subsequent requests with that cookie value the same pool member as the initial request.
Available only when the value of Persistence-type is Persistent-Cookie.
No default.
persistence-timeout <persist-timeout_int>
Type the maximum amount of time between requests that FortiWeb maintains persistence, in seconds.
FortiWeb stops forwarding requests according to the established persistence after this amount of time has elapsed since it last received a request from the client with the associated property (for example, an IP address or cookie). Instead, it again selects a pool member using the load balancing method specified in the server pool configuration.
300
Example
This example creates the persistence policy ip-persistence. When this policy is applied to a server pool, FortiWeb forwards initial requests from an IP address using the load-balancing algorithm configured for the pool. It forwards any subsequent requests with the same client IP address as the initial request to the same pool member. After FortiWeb has not received a request from the IP address for 400 seconds, it forwards any subsequent initial requests from the IP address using the load-balancing algorithm.
config server-policy persistence-policy
edit ip-persistence
set Persistence-type Persistent-IP
set persistence-timeout 400
next
end
Related topics
config server-policy server-pool