Skip to main content

Cookie

The primary function of the COOKIE manager is to store and manage the cookies returned by the server during an interface request, and automatically include them in subsequent requests when necessary.

image.png We can add, delete, modify, and query COOKIES through the COOKIE manager as follows.

image.png

image.png

caution

To carry the cookies in the cookie manager, the switch must be turned on.

image.png A Standard Cookie Expression

test-cookie=fanny;Path=/;Domain=.dev-tools-env-test.apipost.cn;Expires=Sun Feb 26 2023 11:53:02 GMT+0800

The meanings are as follows:

Cookie Field Meanings

test-cookie: The name of the cookie.

fanny: The value of the cookie. If the value is a Unicode character, it needs to be encoded. If the value is binary data, it needs to be BASE64 encoded.

Path: Path: Specifies the URL path where the cookie is accessible. If set to /path/, only pages under /path/ can access the cookie. If set to /, all pages within the domain can access the cookie.

Domain: The domain that can access the Cookie. For example, if set to .apipost.cn, all domains ending with apipost.cn can access the Cookie.

Expires: The validity period of the Cookie.

Instructions for Using Cookies

When the cookie manager switch is on, any cookies set in the header will be overridden and will not take effect.

Scenario One: If cookies are set in both the header and the cookie manager, the parameters in the cookie manager take precedence, and the cookies in the header will not take effect.

image.png

Scenario Two: If no cookies are set in the cookie manager, the cookies specified in the header will take effect.

image.png