[GH-ISSUE #2918] Clearing session data cookie fails for cross origin cookies - it does not use domain setting #9398

Closed
opened 2026-04-13 04:50:38 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @widavies on GitHub (Jun 5, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2918

I believe this line is incorrect:

91d504d81b/packages/better-auth/src/api/routes/session.ts (L117)

It does not factor in the domain option

      crossSubDomainCookies: {
        enabled: true,
        domain: 'example.com',
      },

This causes the cookie to not get cleared:

Image

Originally created by @widavies on GitHub (Jun 5, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2918 I believe this line is incorrect: https://github.com/better-auth/better-auth/blob/91d504d81bcea52a6785eec02dca1626f2b734e6/packages/better-auth/src/api/routes/session.ts#L117 It does not factor in the `domain` option ``` crossSubDomainCookies: { enabled: true, domain: 'example.com', }, ``` This causes the cookie to not get cleared: ![Image](https://github.com/user-attachments/assets/841e2810-15fb-4de8-854d-75544397ae15)
GiteaMirror added the locked label 2026-04-13 04:50:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9398