I get lots of Django CSRF errors due to timeout.
In normal operations, the form submissions are OK. But, if I leave the page for a few hours and then submit it, it will fails with the
Forbidden (403)
CSRF verification failed. Request aborted
screen. To overcome this issue, I added the following line to the settings.py
:
SESSION_COOKIE_AGE = 604800 # one week
But a few hours leading to timeout means that this line has had no effect. I need CSRF tokens longevity be increased to a few days rather than minutes.
How to achieve this?