From the course: Full Stack Web Development with Flask

Unlock this course with a free trial

Join today to access over 22,700 courses taught by industry experts.

Creating sessions and authentication

Creating sessions and authentication - Flask Tutorial

From the course: Full Stack Web Development with Flask

Creating sessions and authentication

- [Instructor] Creating Sessions and Authentication. In this video, we're going to create state management and user authentication using the Flask-Session extension, and it comes with the session object that stores user information very specific to a site in the user, so that's very similar to other sessions in other language, like PHP and so on. Now, the implementation is on top of the cookies and it also signs the cookies cryptographically, so it makes it very secure. And the neat thing is that it's very easy to use and implement. So if you look at the syntax here, you see that it looks very similar to PHP. If you are a PHP developer, you just pass in a key, and you get the value back by issuing the get command, and to destruct a key, you just pop it or just assign that value to false. And again the idea of a session is to make data, retain the data, so they stay active across multiple pages. Alternatively, Flask has…

Contents