Load Balancing/High Availability
This article describes how to set the timeout value for the COOKIEINSERT persistence on a NetScaler appliance.


This article describes how to set the timeout value for the COOKIEINSERT persistence on a NetScaler appliance.


When the Load Balancing feature of a NetScaler appliance is configured and the COOKIEINSERT persistence is configured, the timeout setting becomes a configurable option. In most scenarios, a timeout of 0 is preferred.

After COOKIEINSERT persistence is configured on a virtual server of the appliance, the appliance inserts an HTTP cookie in the client responses, which is then used to maintain a persistent session to the backend server. The appliance can send either an HTTP cookie version 0 or an HTTP cookie version 1. By default, the appliance sends an HTTP cookie version 0.

  • If HTTP cookie version 0 is used, the NetScaler appliance inserts the absolute Coordinated Universal Time (GMT) of the cookie expiration (the expires attribute of the HTTP cookie), calculated as the sum of the current GMT time on a NetScaler appliance, and the timeout value.
  • If an HTTP cookie version 1 is used, the NetScaler appliance inserts a relative expiration time (Max-Age attribute of the HTTP cookie). In this scenario, the client software calculates the actual expiration time.

When session cookies are used with a timeout value of 0, no expiry time is specified by the appliance regardless of the HTTP cookie version used. The session cookie expires when the Web browser is closed. Using session cookies enables COOKIEINSERT to function correctly even if the time on the NetScaler appliance and the servers are not synchronized. The expiry time is client software implementation dependent, and usually such cookies expire when the software is properly closed.

This persistence type does not use any system resources. Therefore, the appliance can accommodate an unlimited number of persistent clients.

Note: If the client computer is not allowed to store the HTTP cookie, the subsequent requests do not have the HTTP cookie. As a result, persistence is not used.


Setting the Timeout Value for the COOKIEINSERT Persistence

On a NetScaler appliance, persistence is maintained for a configured period of time, depending on the persistence type. Use the –timeout <Minutes> option with the add lb vserver or set lb vserver commands on the command line interface of the appliance to configure the persistence timeout in minutes.

add lb vserver vs1 http 80 -persistencetype cookieINSERT -timeout 60


set lb vserver vs1 -timeout 200

The default value for the –timeout option is 2 minutes and the maximum value is 1440 minutes or 1 day.

Configuring Persistence Based on Cookies Using the GUI Utility

In the navigation pane, expand Load Balancing, and click Virtual Servers.
  1. In the details pane, select the virtual server for which persistence must be configured (for example, vserver-LB-1), and click Open.

  2. In the Configure Virtual Server (Load Balancing) dialog box, on the Method and Persistence tab, in the Persistence list, select COOKIEINSERT.

  3. In the Time-out (min) text box, type the time-out value (for example, 2).

  4. Click OK.

  5. Ensure that the virtual server for which persistence is configured correctly by selecting the virtual server and viewing the Details section at the bottom of the pane.

    User-added image

Citrix recommends that when configuring the COOKIEINSERT persistence as the Load Balancing method on the NetScaler appliance, you must use the session cookie with a timeout value of 0.

Note: If you have configured persistence on the appliance, the persistence settings override the server selection that Load Balancing methods made.

Additional Resources

For Configuration Utility Changes for NetScaler 10.1, refer Citrix eDocs -?? Configuration Utility Changes.

Applicable Products


Join the conversation

Citrix Discussions

Open a case

Citrix Support