Closed genu closed 3 weeks ago
Hi @genu
This hook is only used to populate the session for the client-side with dynamic data but it cannot update the cookie, only the returned value for useUserSession()
on the app-side.
is there a a proper way to update a session without having the user Logout and Log back in?
This is a bit related to #255, I would suggest a server middleware that can update the session.
Thanks @atinux I moved the above to a middleware, and it seems to get the job done.
I appreciate it.
I'm running into an issue where, where I'm unable to modify a session from inside of the
fetch
hook.Here is an example.
when this hook runs in SSR context its able to get a updated SAS token based on the current
expiresOn
, however, when I refresh the page, the old cookie value is present.Although the session is updated for the request, the cookie itself isn't updated, so the
isTokenExpired
above will always true because thesession
passed in will always be the session from the cookie.I hope that makes sense.
is there a a proper way to update a session without having the user Logout and Log back in?