Skip to content

TanStack/Start useSession<>() does not persist on Safari, all auth examples are broken. #3492

Description

@bhouston

Which project does this relate to?

Start

Describe the bug

This example, examples/react/start-basic-auth, only works in Firefox and Chrome. It does not work in Safari 18.3 on MacOS 15.3.1. I am using TanStack Start 1.107 (the latest) with TanStack Router 1.107 (the latest.)

The main issue is that login uses useSession<> from tanstack/start and it appears to not persist the cookie in Safari. I suspect there is slightly different cookie handling in Safari as compared to the other browsers.

Your Example Website or App

https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-auth

Steps to Reproduce the Bug or Issue

Open up Safari on MacOS - I am using the latest release version for everything (no betas) - Safari 18.3 on MacOS 15.3.1.

If you haven't created a local account in the sqlite DB, Go to signup and create a new account.

Then go to login and try to log in. It will succeed in the login, but the top nav will continue to have "Login" listed, rather than your username/email with "Logout."

This is a sign that cookies are not persisting in Safari.

Expected behavior

Safari should work like Chrome and Firefox.

Screenshots or Videos

output.mp4

Platform

  • OS: MacOS 15.3.1
  • Browser: Safari 18.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions