Setting global JS variable in screen
Application Type
Traditional Web

Hi Community, 

       How to set the Javascript Global variable for screen without any vulnerability.



Hello Balaji ,

You can use a Session Variable to store information that will always be available during the user's session and use it with your JS code.

To learn more about Session Variables please follow this link :

Session Variable

Hope it helps!

Paulo Rosário

Hi Paulo,

        I want to save the global variable in Javascript without any vulnerability and dont want to maintain any session variable.



and if you save that value encrypted?

Normally in the front when we save the data of a user and his token.

we save it in session or cookies and encrypted.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.