Demo front-end cookies
A simple example with a server that sets/deletes cookies when you visit different routes.
- Run
npm i
- Run
npm run start
- Visit http://localhost:3000/addcookie in your browser, the server will send a cookie, open your devtools Storage tab to view cookies for localhost to see it
- Refresh the page, your browser will send the cookie that was previously set automatically, so the server will see it
- Visit http://localhost:3000/removecookie and check your cookies again - the abc cookie should be deleted