Mixins and dependencies

The items in this section contain supporting code for the views. The cookie reader/writer will be used to mock session management. The form utility mixin will be used to validate the individual form elements in all of the forms.

Reading and writing cookies

Maintaining a user session can be complex. To make it as real as possible, the session detail is put into cookies. Reading and writing cookies is a simple parsing process, but there's no need to suffer the minutiae of it. So, we picked up a simple cookie reader/writer JavaScript utility from the Mozilla Developer Network (MDN) cookies documentation page (https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie). This code was put into the file cookie.js and placed ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.