Using cookies
Since our application doesn't rely anymore on a global sample data file to answer important questions such as whether a user is currently signed in or not, what the user's information is, and so on. The frontend application now makes use of browser cookies for this. A simple definition for browser cookies is that they are small pieces of information that get stored in the user's device using the web browser. This information can then be simply retrieved from the cookie when needed.
The frontend code makes use of cookies to easily save and retrieve the user's information to populate different screens and React components that need this information. This is done using the js-cookie JavaScript package. This package can be installed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access