Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support partitioned attribute to manage the phasing out of third-party cookies #446

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-cookie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Set a cookie value
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `removeCookie(name, [options])`

Expand All @@ -98,6 +99,7 @@ Remove a cookie
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `updateCookies()`

Expand Down Expand Up @@ -151,6 +153,7 @@ Set a cookie value
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `remove(name, [options])`

Expand All @@ -165,6 +168,7 @@ Remove a cookie
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

## Simple Example with React hooks

Expand Down
3 changes: 3 additions & 0 deletions packages/universal-cookie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Create a cookies context
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `get(name, [options])`

Expand Down Expand Up @@ -71,6 +72,7 @@ Set a cookie value
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `remove(name, [options])`

Expand All @@ -85,6 +87,7 @@ Remove a cookie
- secure (boolean): Is only accessible through HTTPS?
- httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement
- partitioned (boolean): Indicates that the cookie should be stored using partitioned storage

### `addChangeListener(callback)`

Expand Down
1 change: 1 addition & 0 deletions packages/universal-cookie/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface CookieSetOptions {
secure?: boolean;
httpOnly?: boolean;
sameSite?: boolean | 'none' | 'lax' | 'strict';
partitioned?: boolean;
}
export interface CookieChangeOptions {
name: string;
Expand Down