Uninett / Howitz

1 stars 3 forks source link

Improve flask session usage #102

Open podliashanyk opened 1 month ago

podliashanyk commented 1 month ago

Make sure that:

hmpf commented 2 weeks ago

On testing another branch today I got the following error:

/../.virtualenvs/howitz/lib/python3.10/site-packages/werkzeug/sansio/response.py:261: U
serWarning: The 'session' cookie is too large: the value was 4159 bytes but the header requi
red 26 extra bytes. The final size was 4185 bytes but the limit is 4093 bytes. Browsers may 
silently ignore cookies larger than this. 
 dump_cookie(

While the sorted list of event ids and what is selected is session specific, the list of known events is not and can be cached.

hmpf commented 2 weeks ago

Given a session id, we can store sessions in the cache too, just have to remember to delete it on logout.

See https://flask-session.readthedocs.io/en/latest/usage.html#using-cachelib-as-a-session-backend