My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Best way to store user data in local storage?

Yashu Mittal's photo
Yashu Mittal
·Feb 8, 2020

What is the best way to store user data in the local Storage?

Storing data with individual property

'userId': '234353-645657-75675675-5575'
'token': 'fgdfgfggergverger.t45regverrgt.he'

or include all the user data inside a big json object.

{
   'userId': '',
   'token': ''
}