简体   繁体   English

Symfony-CSRF在某些移动浏览器中不起作用

[英]Symfony - CSRF not working in some mobile browsers

I have symfony form that send via ajax and persist/update it on database. 我有通过ajax发送并在数据库上持久/更新它的symfony表单。

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 此过程在桌面浏览器中正常运行,但在移动浏览器(几乎是野生动物园和其他Apple浏览器)上会出现错误: 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) 我使用{{ form_end(form) }}树枝(我的symfony版本是3.2)
  • I increased both max_input_vars and upload_max_filesize properties of my php.ini . 我增加了php.ini max_input_varsupload_max_filesize属性。
  • 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便无法创建会话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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