I'm currently doing the PHP OOP Login/Register tutorial. I am at part 12 at the moment and I have a problem. I wrote exactly the same code for the Session and Token class but when I submit my form using post I have to click twice the submit button before the script is actually runned.
It looks like since the code is on top of the page and runned before the Token::Generate(), it takes two times before it actually compares to the same token.
I really don't know how to fix this problem. If someone has a quick fix, I'll appreciate it
Thanks in advance.