electron/docs/api/structures/cookie.md
Samuel Attard 1d158399a6
feat: expose the sameSite value for cookies (#22789)
* feat: expose the sameSite value for cookies

* Apply suggestions from code review

Co-Authored-By: Charles Kerr <ckerr@github.com>

* Apply suggestions from code review

Align with cookie samesite values for the extensions API

https://developer.chrome.com/extensions/cookies#type-SameSiteStatus

* chore: add tests for sameSite cookies get/set

* chore: update docs parser

* chore: update docs for MessageChannel and MessagePort to have correct process information

* chore: remove LOG warning

* chore: throw error if the string->samesite conversion fails

Co-authored-by: Charles Kerr <ckerr@github.com>
2020-04-02 11:28:43 -07:00

15 lines
1 KiB
Markdown

# Cookie Object
* `name` String - The name of the cookie.
* `value` String - The value of the cookie.
* `domain` String (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains.
* `hostOnly` Boolean (optional) - Whether the cookie is a host-only cookie; this will only be `true` if no domain was passed.
* `path` String (optional) - The path of the cookie.
* `secure` Boolean (optional) - Whether the cookie is marked as secure.
* `httpOnly` Boolean (optional) - Whether the cookie is marked as HTTP only.
* `session` Boolean (optional) - Whether the cookie is a session cookie or a persistent
cookie with an expiration date.
* `expirationDate` Double (optional) - The expiration date of the cookie as
the number of seconds since the UNIX epoch. Not provided for session
cookies.
* `sameSite` String - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy applied to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`.