0

I'm developing a front-end project using reactjs. I'm saving the return from my server using localStorage, is there a more efficient & secure method for saving user data in the browser?

localStorage.setItem('user', data);

// Recupere Data
var user = localStorage.getItem('user');
console.log(user);


/* Output */
{_id:1, name: "name here", email: "email@email.com" }
Rob Quincey
  • 2,834
  • 2
  • 38
  • 54
Danieldms
  • 1,006
  • 9
  • 11
  • I think this question has nothing about React, you could search solutions for authentication persistent – MarkoCen Jun 15 '16 at 18:11
  • Yes, i understand, i changed tags and add a tag authentication... I put Reatctjs because i'm developing using reactjs.. – Danieldms Jun 15 '16 at 18:18

1 Answers1

1

yes use Redux with local storage: Where to write to localStorage in a Redux app?.

use memonization and service workers with caching capability. if your app is progressive

Community
  • 1
  • 1
Mike Tronic
  • 540
  • 3
  • 5