Save information of ID's (BD) in localStorage is a bad practice?

Sometimes I use localStorage to store information after a login as "idclient", "name" and then use this data in other views of the system, where the user interacts with the system. Without the localStorage, and using PHP, before I was using session variables to persist data, but now prefer to use LocalStorage, because it's more comfortable and easy using, but do not know if what I do is bad practice or not?

Upvotes: 2

Views: 180

Answers (1)

Raul Claus
Raul Claus

Reputation: 290

You can save navigation data or data that betters user experience, but I don't think you should store idclient or other critical backend information on the frontend for security reasons. Check the access_token model that is widely used in most descent open APIS like twitter;

https://dev.twitter.com/docs/api/1/post/oauth/access_token

Upvotes: 1

Related Questions