简体   繁体   中英

Symfony lifetime CSRF token

How can I get a lifetime (expires) of CSRF token in Symfony 3? I want to set the meta tag "refresh" on my login page in order to avoid errors with csrf token expired.

Following is a better solution than changing the CSRF token lifetime .

However, the point behind CSRF tokens is that they change frequently so that nobody can try to steal one of those tokens and then use it to make a forged request. Here's the workflow I always used in my application. So, PHP Frameworks Doesn't matter logic remains the same I have done this process in Laravel, CodeIgniter, Symfony etc.

  • Request a CSRF token.
  • Use the token to make requests.
  • If the request fails because the token has expired, go to step 1.

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