CSRF not updating on very next request
I've noticed that If a user posts a form, is then redirected back to the same page and tries to post the same form again he gets a "TokenMismatchException". But if after the redirect he refreshes the page and then tries to post it - everything works. It looks like this is because the CSRF token is not updated after the redirect, it's only updated after the user enters another page after redirect. Any way to fix this? Or am I doing something wrong?
Update: I've looked more in to it and understand why it doesn't have a new token for the very next request, but is there anyway around this to update it on next request? Without disabling CSRF.
Please or to participate in this conversation.