Reloading XSRF token on browser 'back' button?

Ralf Schlatterbeck <[email protected]> Wed, 4 Dec 2024 09:26:22 +0100
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
I'm currently experiencing problems with users hitting the browser
'back' button. Currently the double-submission javascript prevents the
page from being submitted again (resulting in the message "please be
patient").  A user complains that she's been patient for weeks now :-)
I can easily fix this by resetting the 'submitted' variable on page load
(which is, fortunately, also triggered on browser 'back' button). But
the XSRF token has already been used and we get an error on the second
submission.
Now the user can just submit again (because the page with the error now
has a new XSRF token) but they might give up (losing all data entered
into the form).

Is there an easy way to obtain a new XSRF token when the user hits the
'back' button (I can detect this condition by checking the 'submitted'
javascript variable).

Thanks
Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]