I've added an object in LocalStorage
as follows:
user: {
authenticated: false,
email: '',
id: '',
cpf: ''
}
localStorage.setItem('userData', this.user)
When I'm going to recover, localStorage.getItem('userData')
is returned [Object Object]
and I can not access the properties of the user
object.
jsFiddle
What's wrong?