obsidiannovels
Member
Anyone here versed in frontend dev?
I was wondering what's the best way of handling logins on a website.
So let's say the user logins through a form and the frontend makes a request to the backend and retrieves the username, pass, etc.
What is the best way to keep a user logged in, even if they refresh the site in the browser? In a single page application I guess I could store the username, etc. in an object or an array, but that would be cleared if the user refreshed the page.
I guess there's localstorage, but I don't think you can save objects there, only strings/variables.
What's the best/proper way of keeping a user logged in until he closes the browser?
I was wondering what's the best way of handling logins on a website.
So let's say the user logins through a form and the frontend makes a request to the backend and retrieves the username, pass, etc.
What is the best way to keep a user logged in, even if they refresh the site in the browser? In a single page application I guess I could store the username, etc. in an object or an array, but that would be cleared if the user refreshed the page.
I guess there's localstorage, but I don't think you can save objects there, only strings/variables.
What's the best/proper way of keeping a user logged in until he closes the browser?