Questions tagged [flask-session]
153 questions
19
votes
1 answer
Flask session doesn't update consistently with parallel requests
I'm noticing that when requests running in parallel modify Flask's session, only some keys are recorded. This happens both with Flask's default cookie session and with Flask-Session using the Redis backend. The project is not new, but this only…

Brown Bear
- 19,655
- 10
- 58
- 76
15
votes
7 answers
When I do Flask run, it shows error : ModuleNotFoundError: No module named 'werkzeug.contrib'. Can anyone help me with this?
the exact error I get is :
flask.cli.NoAppException: While importing "application", an ImportError was raised:Traceback (most recent call last):
File "/home/harshit/.local/lib/python3.6/site-packages/flask/cli.py", line 240, in …

Harshit
- 153
- 1
- 1
- 4
14
votes
2 answers
Clean server-side session files - Flask-Session using filesystem
I chose to use a server-side session management with Flask using Flask-Session.
I store the data using filesystem and as expected, these files are stored under a /flask_session folder in my config directory.
Here is how I set this up in my…

smallwat3r
- 1,037
- 1
- 8
- 28
9
votes
4 answers
Python session SAMESITE=None not being set
I am having issues with chrome and SameSite. I am serving a webpage in a shopify iframe and when setting the session using flask-login, chrome tells me this:
A cookie associated with a cross-site resource at
URL was set without the
SameSite…

Christian Quintavalle
- 121
- 1
- 1
- 3
7
votes
2 answers
Setting flask session variable outside request context (inside a generator)
I have a flask view which is executed to load some information in a generator (I am using a generator so that I can continuously yield the progress - how much information has loaded). Here is what the view looks like:
@app.route("/progress",…

Karan
- 11,509
- 8
- 34
- 38
6
votes
1 answer
How to pass an object between app routes in a Flask app if it is a dataframe with null values and a column that has numbers separated by underscores?
I am working on a web app where a user will upload a .csv file, which is rendered into html on the next page. Then, that same .csv file (or the pandas dataframe that it was imported into) needs to be used on the following page. So I need to move…

Stonecraft
- 860
- 1
- 12
- 30
4
votes
1 answer
Flask_session ignore OPTIONS requests
I am writing an applition where I need to use JavaScript's "Fetch" and because of CORS, all my requests have a pre-flight OPTIONS request. This means that in my session database, it creates a new session everytime an OPTIONS request is made. I do…

Derekm4n
- 41
- 1
3
votes
2 answers
'Flask' object has no attribute 'session_cookie_name'
I keep getting the error 'Flask' object has no attribute 'session_cookie_name' right at initialization on an app that used to work.
I built a smaller test app to test it and noticed that if I remove the line app.config["SESSION_TYPE"] = "filesystem"…

Bax66
- 33
- 4
3
votes
1 answer
Flask login vs. Apache caching
I'm a novice web developer, but experienced python programmer, and Apache dolt. Recently, I've been tinkering with hosting a small website and learning my way through some hosting issues, Flask, html templates, etc.
I've followed several Flask…

AirSquid
- 10,214
- 2
- 7
- 31
3
votes
0 answers
Flask Session list not persisting
I', new to Flask and following the CS50 - Web Programming Course. My code is identical to the code ran by the lecturer, but it isn't working , leading me to believe I need some updates to my code since the video is 2 years old.
My problem is that…

Caleb Renfroe
- 183
- 1
- 13
3
votes
2 answers
Invalid session / Session is disconnected
What can be the reasons that cause a socket.io session to be crashed and server returns invalid session or session is disconnected ?

Mouna Ben Ayed
- 53
- 1
- 7
3
votes
3 answers
PGadmin4 on Kubernetes: Session invalidated when using ELB
I have a weird problem with PGAdmin4.
My setup
pgadmin 4.1 deployed on kubernetes using the chorss/docker-pgadmin4 image. One POD only to simplify troubleshooting;
Nginx ingress controller as reverse proxy on the cluster;
Classic ELB in front to…

whites11
- 12,008
- 3
- 36
- 53
3
votes
2 answers
Apache showing Permission denied: flask_session error
Im trying to get flask with virtual environment and wsgi configured to work but Apache keeps giving me this error:
[Tue Nov 13 13:23:55.179153 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] app.session_interface = self._get_interface(app)
[Tue…

Cayenne
- 94
- 9
3
votes
0 answers
Unable to get PHPSESSID to work in Ubuntu 18.04 with Redis and Flask-Session
I know this question might be a bit obscure, and might not even be in the right stack exchange. So I'm going to start here.
I'm running flask and flask-session with redis
My app config is setting the SESSION_TYPE to 'redis'
I'm also using…

CodeLikeBeaker
- 20,682
- 14
- 79
- 108
3
votes
0 answers
prevent flask session from reloading on ajax call
So, I am trying to make a flask session expires after a certain amount of time.
After a user login is validated I set session.permanent = True
In my config I have
PERMANENT_SESSION_LIFETIME = timedelta(minutes=1)
SESSION_REFRESH_EACH_REQUEST =…

Felipe Emerim
- 363
- 2
- 12