0

How we can check the values in session storage? I mean, if i need to check what are the values stored in Session storage, how we can check that?

Ajish
  • 51
  • 4
  • 1
    do you know the names of keys for the values? – Chandra Kanth May 15 '20 at 07:56
  • 2
    Does this answer your question? [Looping through localStorage in HTML5 and JavaScript](https://stackoverflow.com/questions/3138564/looping-through-localstorage-in-html5-and-javascript) – Roy M J May 15 '20 at 08:00
  • when we don't know the name of key. i want to get all the values in session storage – Ajish May 15 '20 at 09:33

1 Answers1

0

set the key and value like this

sessionStorage.setItem("user-id", userId);

and extract it like this using key

userId = sessionStorage.getItem("user-id")
Shlok Nangia
  • 2,294
  • 3
  • 15
  • 24