
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI've encountered this frustrating login loop issue before, and it's typically related to browser cookie settings or CORS configuration. Here are the solutions that usually work:
1. Check Third-Party Cookie Settings
The most common cause is browser blocking third-party cookies. Sanity Studio authentication relies on cookies to maintain your session. Try these steps:
sanity.io and localhost)2. Clear Browser Cache and Cookies
Sometimes stale authentication data causes loops:
localhost:3333 and sanity.io3. Try a Different Port
There might be a conflict with port 3333. As mentioned in the localhost:3333 documentation, you can change your Studio port by modifying sanity.cli.ts:
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({
server: {
port: 3334, // or any other available port
},
// ...other settings
})Or run: sanity start --port=3334
4. Check Your Project Configuration
Make sure your sanity.config.ts (or sanity.json in older versions) has the correct project ID and dataset name. A mismatch can cause authentication issues.
5. Verify CORS Settings in Sanity Manage
http://localhost:3333 is listed (add it with credentials allowed if it's not there)6. Try Incognito/Private Mode with Relaxed Settings
While you mentioned trying private mode, make sure to temporarily disable any extensions and allow third-party cookies even in private mode for testing.
If none of these work, there might be an issue with your Sanity project setup itself. You could try creating a fresh Sanity project to see if the issue persists, which would help isolate whether it's a configuration problem or a browser/system issue.
The third-party cookie issue is by far the most common culprit for this specific login loop behavior on localhost, so I'd start there first!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store