Closed NeuroAssassin closed 1 year ago
@NeuroAssassin this issue is because of an bug in cachelib . pallets/cachelib/pull/12. on windows cachelib set fails when the cache file already exist. it need to be fixed in cachelib by chaning os.rename to os.replace.
in cachelib the error is suppressed and instead it returned False
.
probably in https://github.com/fengsp/flask-session/blob/master/flask_session/sessions.py#L353 the return code needs to be checked and probably raise an exception.
@snjypl Thanks for getting back. Great to know that that issue has been seen. Do you know anything about the issue with the session resetting constantly though? I was getting that before I updated.
@NeuroAssassin this issue is because of an bug in cachelib . pallets/cachelib/pull/12.
That pull seems to be merged. I still have the issue. What to do?
you can try installing it from git
pip install git+https://github.com/pallets/cachelib.git@master
Been searching for a week to finally narrow it down to flask-session update (I was using werkzeug < 1 before v0.3.2).
Thanks for the info ! Unfortunately I think it means downgrading again in the meanwhile...
@NeuroAssassin @snjypl @Adityashaw @GChalony
That upstream fix (https://github.com/pallets/cachelib/pull/12) was released in its 0.1.1
version 7 hours ago. And, given that flask-session currently always picks up latest version of cachelib, you should be able to update your environment and then test it out.
Closing as fixed w/ @rayluo comment. please comment back or open a new issue if there is still problem.
Hey there. I've been using
flask-session
for a while now, and I have had one moderate continuous problem throughout, and with the new update, I'm having a major issue.First, with the new update switching to cachelib, I can't set anything in session. I have a button that sends a web request to another endpoint on my site, which sets a variable in session using
session['theme']
, but when I reload the page, it's back to how it was.Second, I've noticed that quite a lot, the session will just... refresh. I'll lose everything I have in my cookies, resetting my authorization and also the theme I have set, which can be real annoying.
If you could fix the above issues, or point me to what I'm doing wrong, that'd be great. If you want to take a look at the code I'm using, head to the
Toxic-Cogs
repo on my account, then look indashboard\data
on thedashboard-testing
branch. Thanks.