philip
BABetter Auth
•Created by philip on 3/5/2025 in #help
How should I store session / user data on client
Hey, so how should I store session / user data on the client? So I know that I can retreive the full session and user object from my authClient with useSession() or I can setup and endpoint like /api/me and fetch the objects from my API.
But should I fetch them just one time on signIn for example and keep these objects in my local storage or cookies and delete them when the user logs out or just fetch them anytime I need them? For example for Username, Image in a Navbar or something like this I hope my point is clear
Just for reference, currently using a vite vue app for frontend and express.js for backend
(I would also be open to completely switch to a fullstack framework like next.js if anybody would advise me to, I'm just familiar with vite and vue thats why I chose this)
Sorry if it's a stupid question, I'm new to web development
9 replies