My web application allows multiple users to log in using different credentials in separate tabs or browsers on the same machine. I achieve this by initializing Firebase with a unique app name for each login session.
When a user closes the tab or reloads the page, I automatically log them out using the signOut method from Firebase auth.
Now, I want to implement a Remember Me feature on my app page. This feature will remember the user's login information and allow them to access the app without entering their password again, even if the machine is restarted.
How can I achieve this functionality securely?
One approach I am considering is generating a token on the client side when Remember Me is activated and storing it in a cookie. This token would be linked to the user's password in a database table. However, storing passwords as-is in the database is not recommended, and sending the password back to the client poses security risks.
Are there any better alternatives for implementing the Remember Me feature?