Skip to content

Commit 05a4e31

Browse files
committed
add documentation for Cookie
1 parent 7f9bcb4 commit 05a4e31

File tree

8 files changed

+53
-0
lines changed

8 files changed

+53
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
99
_Changes since 1.7.3_
1010

1111
### Added
12+
- Cookie support (Default disabled. Enable in the Subproject Configuration Dialog)
1213
- On pre-flight, update environment variables according to request headers, query parameters and bodies
1314
- A "Save Raw" button at the response viewer to save raw response body to a file
1415

144 KB
Loading
135 KB
Loading
84.9 KB
Loading
30 KB
Loading
137 KB
Loading

doc/features/cookie.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Cookie
3+
---
4+
5+
# HTTP Cookie
6+
7+
## Enable or Disable
8+
9+
To enable Cookie support, first enable in the Subproject Configuration dialog. It would affect the whole Subproject.
10+
11+
By default, Cookie is disabled.
12+
13+
![Enable Cookie Step 1](../cookie-enable-step-1.png)
14+
15+
![Enable Cookie Step 2](../cookie-enable-step-2.png)
16+
17+
## Receive Cookie
18+
19+
To receive Cookie from servers, an environment must be selected or created. Cookie storage is not shared among multiple environments.
20+
21+
## Send Cookie
22+
23+
If Cookie is enabled, the Cookie storing in the storage would be applied to matching requests automatically. To examine what Cookie would be applied, check the Cookie tab in the Request Example level.
24+
25+
To send custom Cookie in additional to stored Cookie, one can insert Cookie in the Cookie tab in the Request Example level:
26+
27+
![Cookie Editor in Request Example](../cookie-editor-in-request-example.png)
28+
29+
or in the Environment level:
30+
31+
![Cookie Editor 1 in Environment](../cookie-editor-1-in-environment.png)
32+
33+
![Cookie Editor 2 in Environment](../cookie-editor-2-in-environment.png)
34+
35+
## Variables and Functions
36+
37+
Variables and functions are supported only in the "value" field.
38+
39+
However, Cookie containing variable and function macros in the "Set-Cookie" response headers are automatically dropped for security reasons.
40+
41+
For example, in the following response, only the cookie "cookie1" would be stored.
42+
43+
```
44+
HTTP/1.1 204 No Content
45+
Set-Cookie: cookie0=some-${{var}}; Max-Age=3600
46+
Set-Cookie: cookie1=AbcDE; Max-Age=3600
47+
```
48+
49+
## Applicable Transports
50+
51+
All types of supported HTTP transport, including WebSocket, GraphQL and gRPC, support Cookie. Note that response headers "Set-Cookie" only take effect after the entire request is completed.

doctave.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ navigation:
1515
- path: doc/features/environments.md
1616
- path: doc/features/ssl-configuration.md
1717
- path: doc/features/functions.md
18+
- path: doc/features/cookie.md
1819
- path: doc/features/user-script.md
1920
- path: doc/features/post-flight-actions.md
2021
- path: doc/features/viewing-responses.md

0 commit comments

Comments
 (0)