DEV Community

Discussion on: Using LocalStorage with React

Collapse
 
faiqfarzan profile image
Muhammad Farzan Faiq

I think you need to use sessionstorage as compared to localstorage because sessionstorage terminate session after browser close but localstorage don't do it.

Collapse
 
kevhines profile image
kevhines

Yeah, I didn't know the difference between those when I started.
I've since read this:
robinwieruch.de/local-storage-react

In either case I don't love them as long term solutions so I'll probably stick with localstorage for now.

Collapse
 
tbm206 profile image
Taha Ben Masaud

That would depend on the use case.