I've been working on creating a login page for my web application using express-session. So far, I've successfully implemented the functionality to validate login credentials.
After confirming a valid login, I execute the following code within the app.post() method.
request.session.loggedIn = true
request.session.username = data[0].account_user
response.redirect('/')
When redirected to the home page, I'm wondering how I can access the values of these variables and update the frontend accordingly.
My goal is to display login/signup buttons if no user is logged in, and to hide them and show the user's username if they are logged in.