javascript - Is it a good practice to invalidate cookie/localStorage data when signing out? -


i have spa written in react , store access token in localstorage , when make api requests, local storage , send header.

my questions:

1) practice remove data localstorage when user signs out? or should ask backend developer add /signout endpoint?

2) there security concerns should take account if store access token in local storage?

as answer question one. 1) should invalidate token / session in backend depending on api design.

2) it's recommended store tokens in bestcase in cookies because of security concerns, webstorage few possible security concerns.

https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -