Lesson 9.1

The cookie round-trip

What a cookie is on the wire, why Set-Cookie cannot share the overwrite map, and the first build - parsing the inbound Cookie header into a lazy req.cookies getter.

25 minsrc/cookies.js, src/request.js
  • Diagram the Cookie and Set-Cookie field names moving in opposite directions.
  • Explain the header-storage asymmetry and why Set-Cookie must be stored as a list.
  • Parse one or more Cookie fields into a null-prototype, lazily cached req.cookies map.
Locked

This chapter is part of the framework capstone. Chapters 1 and 2 are free to build - unlock the rest to keep going.

Unlock the depth