Repository navigation
fix: popouts and reconnects on Safari over http://localhost failed with "Session id mismatch" - #1250
Open
mariobuikhuizen wants to merge 1 commit into
Open
mariobuikhuizen wants to merge 1 commit into
mariobuikhuizen wants to merge 1 commit into
Conversation
maartenbreddels
temporarily deployed
to
fix/safari-localhost-session-cookie - solara-stable PR #1250
October 8, 2026 12:14 — with
Render
Destroyed
mariobuikhuizen
force-pushed
the
fix/safari-localhost-session-cookie
branch
from
October 8, 2026 12:14
42b8797 to
2f063bb
Compare
…th "Session id mismatch" Chrome and Firefox accept a Secure cookie from http://localhost, Safari does not (https://bugs.webkit.org/show_bug.cgi?id=218980). Since the server set the session cookie with Secure + SameSite=None on localhost, Safari never sent it back. The first page load worked, because a websocket without a cookie falls back to a fresh session id, but a reconnect or an ipypopout popout then reached the same kernel with a different session id and was refused with "Session id mismatch", leaving a spinner. This is what jdaviz users hit when running jdaviz from the terminal. Over plain http the session cookie is now SameSite=Lax without Secure, on localhost too. That cookie is still sent to an iframe when the embedding page is on localhost as well. Over https, directly or via x-forwarded-proto, it stays Secure + SameSite=None so cross-site iframes keep working. A session mismatch that involves a cookieless session is now logged as a warning that explains the missing cookie, instead of as a possible hack attempt. Supersedes #234. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mariobuikhuizen
force-pushed
the
fix/safari-localhost-session-cookie
branch
from
October 8, 2026 12:35
2f063bb to
ad76d46
Compare
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reported by the jdaviz team: running
jdavizfrom the terminal (solara server onhttp://localhost:<port>) and popping out a viewer gives a spinner, and the console showsValueError: Session id mismatch.Cause: Chrome and Firefox accept a
Securecookie fromhttp://localhost, Safari does not (WebKit bug 218980, still open). The server set the session cookie withSecure+SameSite=Noneon localhost, so Safari never sent it back. The first page load still worked, because a websocket without a cookie falls back to a fresh session id (#379), but a reconnect or an ipypopout popout then reaches the same kernel with a different session id and is refused.Changes:
SameSite=LaxwithoutSecure, on localhost too (starlette and flask). That cookie is still sent to an iframe when the embedding page is on localhost as well (same site, the port does not matter). Over https, directly or viax-forwarded-proto, it staysSecure+SameSite=Noneso cross-site iframes keep working.Supersedes #234.
Tests
test_session_cookie_attributes(integration, flask + starlette): plain http givesSameSite=LaxwithoutSecure;x-forwarded-proto: httpsgivesSecure+SameSite=None.test_session_mismatch_without_cookie_is_not_logged_as_hack_attempt(unit).popout_test.pystill passes on Chromium. Playwright WebKit cannot run on this machine (missing system libraries), so the Safari behaviour itself was not exercised in a browser here.🤖 Generated with Claude Code