From the course: Flask Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implementing sessions and cookies

Implementing sessions and cookies

From the course: Flask Essential Training

Start my 1-month free trial

Implementing sessions and cookies

- [Man] One of the great features of Flask is how easy it makes it to save information into a cookie so that when a user comes back to a website, we can have some data ready for them to see, so if you don't know how sessions or cookies work, essentially it's a way to store some information into a user's browser, it uses it as a key value store to say, hey I want to store this particular thing so that whenever I come back I can get that information. If you've ever used a keep me signed in button on a website, that utilizes cookies in order to make that happen, so in our particular Flask app here, if we want to use cookies, we have to import them up at the top, and we do that by adding to our long import line here, session, and session allows us to access those cookies, so we'll go ahead and add that up at the top. Now, the question is, how do we want to use cookies inside of our site. Well, I think it would be really neat for…

Contents