Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.


Preserve the User State with Cookies


Currently, when you login as an authenticated user then refresh the browser, the authenticatedUser state resets to its default value of null. There is no authenticated user in state, so the app redirects to the main page.

In this step, we'll preserve the user's state across page refreshes by implementing a cookie that keeps track of (or "remembers") the authenticated user ...