Files
main.tsmain
What you'll learn
- Register express-session with a secret and explain resave, saveUninitialized and the memory store's limits
- Read and write a visitor's session from a handler with @Session(), and know when the cookie is set
- Destroy a session, and place session middleware in the request pipeline relative to guards
Press Run tests to start the app. Its log appears here.Graded endpoints
A cat to look at
A second cat
The session stored something for the first time, so this response carries the connect.sid cookie
The cookie came back and the server found the same session
Recorded in the session's recent list
Now at the front of the list
Moves to the front without a duplicate
Most recent first, each cat once
session.destroy() removed the session and its cookie
A new session, counting from one
Nothing remembered