0

I've managed setting up a development environment running Symfony and sulu cmf. For production I have done the same, but then both Symfony and sulu with production-environment setting.

Everything is running fine except one small issue. When I want to log in, Chrome console shows me 'Invalid CSRF token'

I have cleared the cache of both browser and server, but it does not make any difference.

Any suggestions/experience with this issue?

MadHouse
  • 31
  • 7
  • What is the setting of you `display_startup_errors` in the `php.ini` of the system which is not working? You could try set it to on, and see if any error appears then. I know this issue from deprecated configuration, which throws an error, and Symfony is somehow swallowing it. Also check the webserver and symfony logs, the error might be there. – Daniel Rotter Feb 15 '17 at 07:32
  • Thanks for your quick awnser! Unfortunately the loggings don't contain any errors of warnings that are relevant to this problem. Nor do they contain any rows with datetime stamps from around error times. I have activated `display_startup_errors` but i don't see anything popup. Just in the console `POST http://mysite.nl/admin/login_check 401 (Unauthorized)` `{"message":"Invalid CSRF token."}` – MadHouse Feb 15 '17 at 09:10
  • Was `display_startup_errors` on `off` before? If no try that and see if that fixes the problem. – Daniel Rotter Feb 15 '17 at 09:44
  • Check, `display_startup_errors` was for my production set to `off. I've set it to on. Doesn't make any difference. Same 401 error – MadHouse Feb 15 '17 at 10:07
  • Do you have any kind of caching enabled? That could result in a really invalid CSRF token... – Daniel Rotter Feb 15 '17 at 12:29
  • Good one, didn't check that. But that doesn't seem to be the problem. I've disabled twig caching. But either way, the csrf in the input field is different each refresh. – MadHouse Feb 15 '17 at 14:02
  • Do you think you can register for our slack channel at sulu.io? I think it's easier to solve your problem there :-) – Daniel Rotter Feb 16 '17 at 13:03
  • Just registrerend on your site! Awaiting approval. Hope to fix it there, and will report back here with an answer when it's fixed. – MadHouse Feb 16 '17 at 15:18

0 Answers0