Add a cookie persistence configuration


Define the string that the system inserts in an HTTP response message header before the system returns it to the client. It displays the default values for the arguments that you can set.

The Sun Secure Application Switch load balancer inserts cookie strings into HTTP server response objects returned to the client. The client stores the cookies and includes them in subsequent HTTP client requests to the same server. When the load balancer receives a request containing a cookie, the load balancer deciphers the cookie, and then uses an object rule to forward the traffic to the same real Web server where the cookie originated. During the session, HTTP responses use the same cookie, keeping the connection persistent until the client closes the session.

This command defines the persistence rule for the session. Use this command to define the cookie; use the objectRule command to assign a named cookie to an object rule.

The Sun Secure Application Switch uses switched managed cookie mode (also know as cookie-insert) in load balancing. In this mode, the switch makes a load balancing decision, forwards the request to the service, and creates and inserts the cookie in the server's response object. In subsequent client requests, the switch deciphers the cookie and selects the same real service for forwarding.

When you create a real service, the system generates a unique, 32-bit hash key based on the real service name. This key is inserted in the cookieName field, and used to identify the client session. If you specify the cookieDomain and cookiePath fields, they are concatenated with cookieName to produce the actual string that is inserted in the object header. For detailed instructions on entering these fields, refer to:

      http://wp.netscape.com/newsref/std/cookie_spec.html
    

Session persistence, as provided by the Sun Secure Application Switch, is only enabled if you set the cookiePersistence field in the objectRule command. (There may be other cookie fields in the HTTP header that were inserted by the client.)

Access mode

config

Syntax

vSwitch-name loadBalance cookiePersistence

Arguments

Field Name Description
name text A text string assigned to the persistence rule configuration.
cookieName text Optional: The name of the cookie to be inserted into the packet header. The cookie value is equal to the hash key that the switch generated from the real service name. The inserted header takes the form:

Set-Cookie: cookieName=hash_key; path=cookiePath

If specified, the values of cookieDomain, cookieExpires, and secure are concatenated with this.

The default setting is "nnSessionID".
cookieDomain text Optional: The cookieDomain is an optional string for matching a fully qualified domain name (FQDN) using two period characters (.) in the string, such as www.domainname.com. If a cookieDomain is specified, compliant clients will only send the cookie when making a request to that domain.
cookiePath text Optional: A path name, which, if the request has passed domain matching, the clients compare against the URL path attribute before sending the cookie in the request.

The default setting is "/".
cookieExpires text Optional: Either an absolute time and date, or a delta from the current time, that the switch compares to the time and date in the header to see if the cookie is still valid. If the timer has expired, the client stops sending the cookie. Enter the date-string following these conventions:

The format is entered either as Wdy, DD-Mon-YYYY HH:MM:SS GMT or as integer Days|Hours|Minutes|Seconds

If using absolute time, GMT is the only legal time zone, and you must use dashes between the date elements. If you do not specify this argument, the cookie will expire at the end of the user's session. If entering the delta time, it can be qualified by entering Days, Hours, Minutes, or Seconds following the number and separated by a space. If no qualifier is entered, seconds will be used.
secure enumeration Optional: Defines whether or not the 'Secure' keyword will be used in the 'set-cookie' response header. Secure will only be used if the VirtualService appServiceType is HTTPS.

The default setting is "false".

Valid values: true, false