I have a unique variable known as sessionId that comes from a Node application. This variable is actually an encrypted string using aes-256 algorithm.
sessionStorage.setItem('sessionid', apiResponse.credentials)
Right now, I'm storing this variable in sessionStorage, but I'm not completely comfortable with that. Because this variable is quite long, it's used in the header of all http requests to the server for user validation.
I often create constants in a globals.ts file that I later import, like so:
export const agencyid = 'eXrDOJ1zJYI='
However, these constants cannot be modified of course.
Is there a more secure way to store user login information without relying on sessionStorage, or a method to maintain a persistent variable while the angular application is active within the browser session? Can this be achieved through the existing globals.ts file that I already import in around 70 components?
Thank you.