Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Building Web Applications with Flask
  • Table Of Contents Toc
Building Web Applications with Flask

Building Web Applications with Flask

By : Italo Maia
4 (1)
close
close
Building Web Applications with Flask

Building Web Applications with Flask

4 (1)
By: Italo Maia

Overview of this book

If you are a Python web developer who wants to learn more about developing applications in Flask and scaling them with industry-standard practices, this is the book for you.
Table of Contents (12 chapters)
close
close
11
Index

Sessions or storing user data between requests


Sometimes you'll have a scenario in your application where data has to be kept between requests, but there is no need to persist it in the database, like an authentication token that identifies a logged user or which items a user added to his shopping cart. At those times of peril, use Flask sessions.

Flask sessions are a solution for transient storage between requests implemented using browser cookies and cryptography. Flask uses the secret key value to encrypt any values you set in the session before setting it in the cookies; this way, even if a malicious person has access to the victim's browser, it won't be possible to read the cookie's content.

Tip

Because the secret key is used to encrypt the session data, it is important to have a strong value for your secret key. os.urandom(24) will likely create a strong secret key for the deploy environment.

The data stored in the session is transient because there is no guarantee it will be there at...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Building Web Applications with Flask
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon