Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Strange issue with checkToken()

$this->security->checkToken() works strange. In Firefox, I need to re-send the login credentials, 'cause the first time the code before fails. In Chrome, it just fails everytime. I started having this issue a week ago more or less (two as maximum), and the code has been the same for weeks (if ($this->request->isPost() && $this->security->checkToken())).

Can anyone illuminate me?



85.4k

Try to check if a 'favicon.ico' file is missing from your document root.



20.4k

No, I haven't one. But I didn't had knowledge if it existed one in all this time.



20.4k

I marked renskii's answer as correct, but both were right. The problem was that, when I added the checkToken() function along with isPost(), I was creating a true && false situation first, where the second request was true && true (as happened to somebody in the other post). I thinked it was on the security session check I created in the beforeExecuteRoute(), but it isn't.

Well, resuming it, I created the favicon.icofile (BTW, for what it is?) and create a RedirectMatch 204 to it. But I don't get the idea of all of this.