Fetch up-to-date session
What is the best way to fetch an up-to-date session on the client? I need to check if the user is still on the waitlist when they get to a certain page, and I'd rather do this with up to date info. I can always just create an api route to do this, but it's in the user object and would be nice to just refetch the user.
Solution:Jump to solution
you can do this
```ts
await authClient.getSession({ //pull fresh user info from the database
query: {...
5 Replies
pls ping if you answer btw
https://www.better-auth.com/docs/concepts/session-management
@Lukas would this work? this is the api i use
Session Management | Better Auth
Better Auth session management.
my understanding is that getSession just pulls it from cache, is this incorrect?
Solution
you can do this
thank you!