简体   繁体   中英

Laravel expire csrf token or page after form submission

My application has two forms to submit input to perform some transactions and calculation, I want to avoid from re-submission, how can I avoid that?

For eg if user tries to push history back button, he should not see the previous form instead should see page expire or auto redirection to 1st form.

Or how can I set page expiration in Laravel?

As csrf_token expiration do it after timeout and force user to go to 1st page or login page.

You can use the helper of laravel. Form::open(array('url' => 'foo/bar')) Form::close()

In this case laravel will make csrf token instead of you and you will easily avoid of resubmit cases. Also you can yourself make csrf token with this code: Form::token()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM