Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gianmarx's avatar

sessionStorage.getItem('key') not work

I have the following item in session storage:

	Storage {length: 0}
		check: "true"
		length: 1

when I go to call the function

sessionStorage.getItem('check') //null

while if I print

sessionStorage => it tells me that there is not empty, it prints me:

Storage {length: 0} check: "true" length: 1

I specify that all these controls are put into a method and then called into a computed.I don't understand why it gives me null

0 likes
1 reply

Please or to participate in this conversation.