Skip to content

Update url-based-session-syncing guide #930

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

Merged
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
23 changes: 14 additions & 9 deletions docs/upgrade-guides/url-based-session-syncing.mdx
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
---
title: URL-based session syncing
description: Development instances communicating with the Frontend API without third-party cookies.
description: Learn how Clerk development instances keep track of session state.
---

# URL-based session syncing

Development instances created before December 6, 2022 communicate with [Clerk's Frontend API](https://clerk.com/docs/reference/frontend-api) using third-party cookies. More concretely, the authentication state of the current session is transported via a long-lived third-party cookie, between your frontend (e.g. `localhost:3000`) and the Frontend API (e.g. `clerk.happy.hippo-1.lcl.dev`).
<Callout type="warning">
All development instance Clerk apps created after December 6th, 2022 use URL-based session syncing by default, and cannot opt out.
</Callout>

URL-based session syncing (previously known as Cookieless Development mode) is a new, experimental mode of operation for development instances, in which communication with the Clerk Frontend API is done via URL decoration instead.
URL-based session syncing (previously known as Cookieless Development mode) configures your frontend and your Clerk Frontend API to communicate information about the current session state via URL decoration.

<Callout type="info">
This mode only applies to development instances. Production instances remain unaffected and continue communicating with Frontend API using first-party, HttpOnly cookies.
This mode only applies to Development Instances. Production instances remain unaffected and continue communicating with Frontend API using first-party, HttpOnly cookies.
</Callout>

## Migrating to URL-based session syncing
## Migrate to URL-based session syncing

For Development instances of Clerk apps created before December 6th, 2022, by default the authentication state of the current session is passed between your frontend (e.g. `localhost:3000`) and your Frontend API (e.g. `clerk.happy.hippo-1.lcl.dev`) via a long-lived third-party cookie.

To opt-in to URL-based session syncing, perform the following steps:
To opt-in to URL-based session syncing instead, use the following steps:

- In the Clerk Dashboard, navigate to your development instance's [Settings](https://dashboard.clerk.com/last-active?path=settings) page and toggle on **Enable URL-based session syncing**.
- Upgrade `@clerk/clerk-react` to v4.4.5 or later. If your are importing `@clerk/clerk-js` to your project, use v4.18.0 or later.
1. In the Clerk Dashboard, navigate to your development instance's [Settings](https://dashboard.clerk.com/last-active?path=settings) page and toggle on **Enable URL-based session syncing**.
- This toggle is not available in Clerk apps created after December 6th, 2022.
1. In your codebase, upgrade `@clerk/clerk-react` to v4.4.5 or later. If your are importing `@clerk/clerk-js` to your project, use v4.18.0 or later.

## Clerk Account Portal pages and redirects

Expand All @@ -36,4 +41,4 @@ For custom HTML anchors use the Clerk.[`redirectWithAuth`](/docs/references/java

```jsx
<a onClick={() => clerk.redirectWithAuth('your_destination_url')}>My link</a>
```
```
Loading