< Home

cookie

Function

The cookie command creates a cookie matching rule.

The undo cookie command deletes a cookie matching rule.

Format

cookie pattern-string mode { prefix | suffix | exact | any }

undo cookie pattern-string mode { prefix | suffix | exact | any }

Parameters

Parameter Description Value
pattern-string Specifies the matching string. The value is a string of 2 to 128 characters.
mode Indicates the matching mode. -
prefix Indicates the prefix matching mode. -
suffix Indicates the suffix matching mode. -
exact Indicates the exact matching mode. -
any Indicates the any matching mode. -

Views

HTTP scheduling policy profile view

Default Level

2: Configuration level

Usage Guidelines

In an HTTP server cluster, different cookies correspond to different real servers. Load balancing is based on the cookies.

For cookie-based SLB:
  • If an HTTP request packet matches a sticky session entry, the packet is distributed based on the entry.
  • When selecting a new real server for load balancing, select the real server associated with the cookie of theHTTP request packet.

Example

# Create HTTP scheduling policy profile abc, add the cookie rule, and set the matching mode to exact.

<sysname> system-view
[sysname] slb
[sysname-slb] httpclass abc
[sysname-slb-httpclass-0] cookie SLBServerpool=example.abcd mode exact
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >