Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sessions in Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 86
    Comment on it

    Hi All,

    SessionStorage is something we can use to store values in session in Javascript. Below I will demonstrate how we can use it in our project.

    To set Session Value:

    var valueKey = "Value";
    
    function setSession(value) {
        sessionStorage.setItem(typeKey, type);
        sessionStorage.setItem(valueKey, value);
    }
    

    To get Session Value:

    var sessionValue = sessionStorage.getItem(valueKey);
    

    To Clear Session Values:

    sessionStorage.clear();
    sessionStorage.removeItem(valueKey);
    

    Happy Coding.....

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: