简体   繁体   中英

Symfony - CSRF not working in some mobile browsers

I have symfony form that send via ajax and persist/update it on database.

this process work correctly in desktop browsers but on mobile browsers (almost safari and another apple browsers) get error: This CSRF token is invalid. Please try to resubmit the form This CSRF token is invalid. Please try to resubmit the form

  • I use {{ form_end(form) }} twig (my symfony version is 3.2)
  • I increased both max_input_vars and upload_max_filesize properties of my php.ini .
  • My database is up to date.
  • I cleared my app and browser caches.
  • This Work Correctly In Desktop Browsers
  • This Error In Apple Browsers

由于CSRF令牌存储在会话中,因此请确保在移动浏览器上启用了cookie,并且没有cookie便无法创建会话。

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