FallbackStorage fails its purpose with uwsgi's default settings
|Reported by:||aaugustin||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
FallbackStorage stores up to 3072 bytes of messages in cookies and the remainder in the session.
This is controlled by CookieStorage.max_cookie_size = 3072.
- other HTTP headers can take more than 1024 bytes,
- uwsgi's default buffer-size is 4k,
- all the HTTP headers must fit in one uwsgi buffer, otherwise uwsgi barfs.
uwsgi's doc says:
If you plan to receive big requests with a lot of headers you can increase this value upto 64k
uwsgi is a common WSGI app server. To reduce the likelihood of this problem, I suggest to reduce CookieStorage.max_cookie_size to 2048. This is rather arbitrary, but it gives a bit more headroom.
The main purpose of FallbackStorage is to store one or two messages in cookies, to avoid touching the session in possible. 2048 bytes is enough to store about 25 lines of text.