Class 11 Prep

Cookies and Sessions

This lesson focuses on cookies, which are small pieces of data stored as key/value pairs in the browser. As web developers, we can ask a user's browser to store a cookie for us, and each time that user visits our site in the future, they'll pass the cookie data in the request.

Cookies are part of the furniture of the Internet. You've surely heard the term before, even if you didn't know precisely what it referred to. Chances are you've "cleared your cookies" at some point to fix a problem with a website, or to ensure you didn't remain logged into a website on a public computer. Today, you learn about how these tiny but essential pieces of data actually work!

Additionally, we'll also learn how cookies can be used to enable sessions, as we've been using them to access user-specific data on the server-side.

Task Resource Type Link Instructions
Watch Video Lessons Cookies Watch all videos in the playlist
Watch Video Lesson Cookies in Flask Explore the dynamics of cookies, along with how they can be explicitly used in Flask
Watch Video Lesson Cookie-Based Sessions Learn how cookies are used for session management
Read Article An Overview of HTTP This article should be familiar, as it was part of the prep work for class 3. However, this is a good time to revisit it, as aspects of it should make much more sense in the context of cookies. In fact, we've linked you directly to the section that discuses HTTP state and cookies. Enjoy!
Do Review Class 11 Prep Review Solidify your knowledge of the concepts covered in these lessons