As a newcomer to web development, I have successfully added a login functionality on my website. However, I am facing an issue where opening a new tab and accessing the login URL redirects me to the login page even if I am already logged in on another tab. Ideally, I would like to be redirected to the homepage instead.
I am unsure of what part of the code to share as I am not sure what is causing this problem. I am using JavaScript and Backbone.js for the front end. Any help or guidance would be appreciated.
EDIT
After logging in, I receive a user-specific token from a REST service which I then use for further data retrieval. The issue arises when accessing this token in another tab, as it appears to be NULL due to browser session isolation. I need to implement a check to see if a token exists before redirecting to the home page. Where should I store this token to ensure it is accessible across multiple tabs? Your suggestions are welcome.