Skip to content

Commit 8e1293b

Browse files
authored
feat: add setCookie documentation for hostOnly option (#5071)
* feat: add setCookie documentation for hostOnly option * chore: add more detailed description for host only * add hostOnly as return type in get cookie commands as an property if specified when setting
1 parent c516f7b commit 8e1293b

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

docs/api/commands/getallcookies.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ the following properties:
3838

3939
- `domain`: _(String)_
4040
- `expiry`: _(Number)_ _(if specified)_
41+
- `hostOnly`: _(Boolean)_ _(if specified)_
4142
- `httpOnly`: _(Boolean)_
4243
- `name`: _(String)_
4344
- `path`: _(String)_

docs/api/commands/getcookie.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Pass in an options object to change the default behavior of `cy.getCookie()`.
4141

4242
- `domain`
4343
- `expiry` _(if specified)_
44+
- `hostOnly` _(if specified)_
4445
- `httpOnly`
4546
- `name`
4647
- `path`

docs/api/commands/getcookies.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ following properties:
3838

3939
- `domain`: _(String)_
4040
- `expiry`: _(Number)_ _(if specified)_
41+
- `hostOnly`: _(Boolean)_ _(if specified)_
4142
- `httpOnly`: _(Boolean)_
4243
- `name`: _(String)_
4344
- `path`: _(String)_

docs/api/commands/setcookie.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Pass in an options object to change the default behavior of `cy.setCookie()`.
3838
| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/cypress-app#Command-Log) |
3939
| `domain` | Hostname of the current URL | The domain the cookie is visible to |
4040
| `expiry` | 20 years into the future | When the cookie expires, specified in seconds since [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). |
41+
| `hostOnly` | `false` | Whether the cookie is a host-only cookie, (i.e. the request's host must exactly match the domain of the cookie) |
4142
| `httpOnly` | `false` | Whether the cookie is an HTTP only cookie |
4243
| `path` | `/` | The cookie path |
4344
| `secure` | `false` | Whether the cookie is a secure cookie |
@@ -50,6 +51,7 @@ Pass in an options object to change the default behavior of `cy.setCookie()`.
5051

5152
- `domain`
5253
- `expiry` _(if specified)_
54+
- `hostOnly` _(if specified)_
5355
- `httpOnly`
5456
- `name`
5557
- `path`
@@ -123,6 +125,7 @@ following:
123125

124126
| Version | Changes |
125127
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
128+
| [12.6.0](/guides/references/changelog#12-6-0) | Support `hostOnly` option for a given domain. |
126129
| [5.0.0](/guides/references/changelog#5-0-0) | Removed `experimentalGetCookiesSameSite` and made `sameSite` property always available. |
127130
| [4.3.0](/guides/references/changelog#4-3-0) | Added `sameSite` property when the [experimentalGetCookiesSameSite](/guides/references/configuration#Experiments) configuration value is `true`. |
128131
| [0.16.0](/guides/references/changelog#0-16-0) | `cy.setCookie()` command added |

0 commit comments

Comments
 (0)