W
W
wideShift2020-03-14 18:59:10
Flask
wideShift, 2020-03-14 18:59:10

How do sessions work in Flask?

The book says the following: the data stored in the session has a unique key corresponding to your browser's cookie, which ensures that the session data is stored separately for each of the users.

In Flask, there is only secret_key and it is the same for all users, how does this mechanism work in general?
There is no detailed explanation anywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dimastbk, 2020-03-15
@wideShift

The default flag contains client sessions (the session dictionary is encrypted using secret_key and placed in a cookie).
More about sessions in a flask:
https://flask.palletsprojects.com/en/1.1.x/quickst...
There are extensions for storing sessions in the north (when a user has only session_id in cookies), for example:
https://pypi .org/project/flask-session/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question