Nuxt SSR: useFetch session still null in v1.3.13 #1975

Closed
opened 2026-03-13 09:18:21 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @cwandev on GitHub (Sep 20, 2025).

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). 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)
GiteaMirror added the nuxt label 2026-03-13 09:18:21 -05:00
Author
Owner

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

hi, im gonna take a look again

@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

@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

@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.

@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

@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

@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

@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

@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#1975