[GH-ISSUE #4779] Nuxt SSR: useFetch session still null in v1.3.13 #10061

Closed
opened 2026-04-13 05:58:18 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @cwandev on GitHub (Sep 20, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4779

Hi @himself65, I tested the new version today and the issue still occurs in v1.3.13.

Steps and behavior are the same as described in #4722 .

Image

Originally created by @cwandev on GitHub (Sep 20, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4779 Hi @himself65, I tested the new version today and the issue still occurs in `v1.3.13`. Steps and behavior are the same as described in #4722 . ![Image](https://github.com/user-attachments/assets/9747603e-fb9c-44d7-9d12-858660b01d67)
Author
Owner

@himself65 commented on GitHub (Sep 20, 2025):

hi, im gonna take a look again

<!-- gh-comment-id:3314372996 --> @himself65 commented on GitHub (Sep 20, 2025): hi, im gonna take a look again
Author
Owner

@himself65 commented on GitHub (Sep 20, 2025):

https://github.com/user-attachments/assets/1deff9ec-ac7d-4dcd-826e-9b90236d9e6e

I think you setup cookie domain incorrectly, which cause ssr cannot read cookie correctly

<!-- gh-comment-id:3314540647 --> @himself65 commented on GitHub (Sep 20, 2025): https://github.com/user-attachments/assets/1deff9ec-ac7d-4dcd-826e-9b90236d9e6e I think you setup cookie domain incorrectly, which cause ssr cannot read cookie correctly
Author
Owner

@himself65 commented on GitHub (Sep 20, 2025):

I know first render in client is undefined, but it's expeted behavior

<!-- gh-comment-id:3314540966 --> @himself65 commented on GitHub (Sep 20, 2025): I know first render in client is undefined, but it's expeted behavior
Author
Owner

@cwandev commented on GitHub (Sep 20, 2025):

Hi,

Thanks again for taking the time to look into this.

In reply to your comment, I didn’t explicitly set the cookie domain, so it should default to the current request domain (localhost), and I don’t think that’s the issue.

This has worked fine in all versions before 1.3.10.

<!-- gh-comment-id:3314866083 --> @cwandev commented on GitHub (Sep 20, 2025): Hi, Thanks again for taking the time to look into this. In reply to your comment, I didn’t explicitly set the cookie domain, so it should default to the current request domain (localhost), and I don’t think that’s the issue. This has worked fine in all versions before 1.3.10.
Author
Owner

@sonicoder86 commented on GitHub (Sep 21, 2025):

I can still reproduce it with SSR, bot getSession and useSession returns null even when I have the cookie set. https://github.com/sonicoder86/nuxt-travel-log/pull/59

<!-- gh-comment-id:3316073028 --> @sonicoder86 commented on GitHub (Sep 21, 2025): I can still reproduce it with SSR, bot `getSession` and `useSession` returns `null` even when I have the cookie set. https://github.com/sonicoder86/nuxt-travel-log/pull/59
Author
Owner

@Mateleo commented on GitHub (Sep 22, 2025):

Same issue here, did you find a solution ? @sonicoder86

<!-- gh-comment-id:3317730761 --> @Mateleo commented on GitHub (Sep 22, 2025): Same issue here, did you find a solution ? @sonicoder86
Author
Owner

@himself65 commented on GitHub (Sep 22, 2025):

I reopened https://github.com/better-auth/better-auth/issues/4722. Please go comment there to avoid duplicates

<!-- gh-comment-id:3320197260 --> @himself65 commented on GitHub (Sep 22, 2025): I reopened https://github.com/better-auth/better-auth/issues/4722. Please go comment there to avoid duplicates
Author
Owner

@himself65 commented on GitHub (Sep 22, 2025):

Lock as duplicate

<!-- gh-comment-id:3320198635 --> @himself65 commented on GitHub (Sep 22, 2025): Lock as duplicate
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10061