Configure different session persistence rules

Last Updated: Mar 28, 2017

This section explains how to configure different session persistence rules for multiple domain names.

For example, if VIP has two domain names, vip.a.com and img.a.com. You want vip.a.com to have session persistence but img.a.com not to have session persistence, perform the following:

  1. Open the session persistence configuration.
  2. Select Override a service cookie.
  3. Set the cookie name for the domain name vip.a.com only. Do not modify any settings for the domain name img.a.com.

The cookie of a domain name may be inherited by its subdomain name. If you want session persistence for the primary domain names, but not for secondary domain names, you can apply for more VIPs.

This document introduces three common methods to configure cookies for your domain name.

Apache

  1. Open the httpd.conf file and comment the following line.

    LoadModule usertrack_module modules/mod_usertrack.so

  2. Configure in the virtual host.

    1. CookieName name
    2. CookieExpires "1 days"
    3. CookieStyle Cookie
    4. CookieTracking on

Nginx

  1. server {
  2. listen 8080;
  3. server_name wqwq.example.com;
  4. location / {
  5. add_header Set-Cookie name=xxxx;
  6. root html;
  7. index index.html index.htm;
  8. }
  9. }

Lighttpd

  1. server.modules = ( "mod_setenv" )
  2. $HTTP["host"] == "test.example.com" {
  3. server.document-root = "/var/www/html/"
  4. setenv.add-response-header = ( "Set-Cookie" => "name=XXXXXX" )
  5. }
Thank you! We've received your feedback.