nextjs-blog-cms-sanity-v3 icon indicating copy to clipboard operation
nextjs-blog-cms-sanity-v3 copied to clipboard

Error when logging in locally: Not found - Session with sid ___ not found

Open Svish opened this issue 2 years ago • 6 comments
trafficstars

I have set up and deployed the Sanity v3+next.js starter, pulled the created git-repo locally, and followed the configuration steps in the readme.

After booting it up locally via npm run dev, I go to http://localhost:3000/studio and I get the Sanity login. Completing the login, I'm then presented with this error page:

image

If I then refresh the page, I seem to get into the studio fine. 🤷‍♂️

Svish avatar Nov 27 '22 11:11 Svish

How curious 🤔 Some questions to help reproduce:

  • You're using Firefox, right?
  • Is this the first time you've loaded up a Sanity Studio on localhost:3000?

stipsan avatar Nov 28 '22 09:11 stipsan

  • That is indeed FireFox, yes.
  • Previously I've loaded up the Sanity Studio as a separate thing, as was the way with v2, which I believe would load up on localhost:3333, so in that way it is "the first time". But while developing I have of course reloaded the studio multiple times now.

The error seems to happen consistently if I clear out my cookies and session+local storage. I get asked to login, I do that, it crashes, I refresh, and things are fine again. As long as the auth session is good, I can restart the studio and get back into the studio without any crash. Remove the auth session to trigger a new login, and the crash happens again. 🤷‍♂️

Svish avatar Nov 28 '22 09:11 Svish

The same issue for me, too

dimkabuzz avatar Dec 20 '22 22:12 dimkabuzz

You must allow third-party cookies in your browser settings, at least for your sanity project API URL - [PROJECT_ID].api.sanity.io That solved my problem.

dimkabuzz avatar Dec 20 '22 22:12 dimkabuzz

You must allow third-party cookies in your browser settings, at least for your sanity project API URL - [PROJECT_ID].api.sanity.io That solved my problem.

They are allowed, as far as I know. And things work fine, except for that initial login when things crash completely. Refresh, and it's good. 🤷‍♂️

Svish avatar Dec 20 '22 22:12 Svish

You must allow third-party cookies in your browser settings, at least for your sanity project API URL - [PROJECT_ID].api.sanity.io That solved my problem.

They are allowed, as far as I know. And things work fine, except for that initial login when things crash completely. Refresh, and it's good. 🤷‍♂️

I have the same issue. The error is present only on the initial login.

vgeorgiev0 avatar Aug 27 '23 18:08 vgeorgiev0