I am developing a web with React, Redux and React-Cookie. In this web i have a login system, in which I send a POST request to my Backend API that will send me back the user's data I need for my components (including it's token for the cookie), and I need this data to be Persistent. Currently I am storing the user data in my store, and the boolean of isAuthenticated in the local storage of the client (which I don't know how insecure is this procedure). Where should I store this data? maybe in a cookie? Also if you have some advice regarding the way i store the authenticated boolean would be really nice as well.
Where to store user's sensitive data?
2.1k Views Asked by Fran M At
1
There are 1 best solutions below
Related Questions in REACTJS
- What is `_dereq_()` inside React?
- React TypeError: React.renderComponent is not a function
- React - saving a component in the ref callback
- React Rails component: manually triggering a re-render
- React, ES6 - getInitialState was defined on a plain JavaScript class
- How to get multiple selected options value in React JS?
- React.render replace container instead of inserting into
- reactjs datagrid use html
- props is not initialized in react component
- How to display xml data using Reactjs
- hooking up the data model in ReactJS - syntax
- ReactJS: How to use an immutable empty array or object
- How to use Sinon.js FakeXMLHttpRequest with superagent?
- React select onChange is not working
- ReactJS - Tutorial Comment System > Threaded commenting
Related Questions in REDUX
- How to split routes to different files with Redux and React-router?
- redux-saga, TypeError: (0 , _effects.takeLatest) is not a function?
- Expose Redux store api using webpack instead of global
- Using the Angular 2 Http client in order to rehydrate application state in a ngrx meta reducer
- Redux-thunk dispatch is not a function
- show 10 results per page
- Replicating the action on redux-thunk to redux-saga
- redux-saga: tracking multiple async tasks
- Redux saga, rx-observable. With vanilla fetch calls, why the need over thunks?
- Handling many entities on Redux without repetition
- React Native & Redux props correct design pattern
- React native + redux-persist: how to ignore keys (blacklist)?
- How to cancel execution of a previous action upon a new action?
- What is the use of the ownProps arg in mapStateToProps and mapDispatchToProps?
- Concat actually concatenates instead of adds to array. React Native Javascript
Related Questions in LOCAL-STORAGE
- Using html5 localstorage instead of cookies with passport.js
- Javascript: localStorage.getItem(key) not working
- What is the minimum "acceptable" delay for a local storage in an interval loop (for "auto-saving")?
- Ionic local storage and routing
- Android How to save msg into local storage?
- Get image and save in storage
- In angularjs how do you catch an error for ngStorage when localStorage is full?
- Sort object by array within array?
- Storing the last input text whilst using the POST method with PHP
- can i save data of an my app user in a file not data base
- How to save number of times a user has tapped on a view
- How do I clear localStorage with a button?
- Does Python have a default Caching service
- How to increase size of local Storage for sencha app
- Use LocalStorage in WinForms WebBrowser Control - change event not recieved
Related Questions in PERSISTENCE
- Refresh collection / empty cache - using entity manager
- JPA not receiving updated data
- How is it possible for the detached entity to be a persistent object in hibernate?
- Does Consul persist the Key Value store?
- Keeping Score of quiz in javascript website
- Persistence of ActiveMQ Blob Messages
- Repository Pattern with Repository Factory
- Java persistence (Ebean) serialize generated value to Json
- How to temporarily disable the Hibernate entity version checking?
- Custom Instance Store with WorkflowService hosted in IIS
- What are Relational Objects?
- What is the most persistent HTML5 data storage?
- rabbitMQ persistency when consummers die
- Hibernate EntityManager doesn't throw EntityExistsException on persist
- JPA AccessType.Property failing to retrieve value from nested classes
Related Questions in REACT-COOKIE
- Cookies are deleted when I close the browser?
- react-cookie generating empty cookie when refreshing specific route
- page is getting redirected without setting value in state and in localstorage in react
- Use of Cookies between two components
- Set a cookie in react to true all the time
- React: Delete cookie when user closes the browser
- How to set Cookie in Electron React using npm react-cookie package?
- how can we clear complete browser cookies by JavaScript or react?
- Getting cookie.load('csrftoken') undefined in react
- How to detect if a cookie has been deleted
- React Cookie doesn't work with async response
- Trigger when a cookie changes on client's browser? - React JS
- react-cookie unable to set expires or maxAge
- js-cookies does not remove the cookie
- How to set expiration of a cookie at the end of the day (next.js)?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The common practice is to store the
userobject in the local storage and have another key for the token (or you can embed the token inside the user object).There is no need for
authenticatedboolean, you should check if the user exists in the local storage and if it does then your user is authenticated.in your
logoutfunction make sure to delete the user key from your local storage so the above check will return false.