CakePHP 2.x sessions behaving inconsistently between local dev and production

后端 未结 2 1957
野的像风
野的像风 2020-12-18 15:56

I have a CakePHP 2.x site I\'m working on which performs as intended locally. Login works, session flash messages work, etc. When I push the code to my staging/prod server

2条回答
  •  隐瞒了意图╮
    2020-12-18 16:58

    One of the recommendations I came across frequently was to ensure that there was no whitespace after the closing PHP tag in a code-only file (or preferably to not actually have a closing PHP tag). Checking all my files showed that to be the case. Somehow, however, I managed to put a single line break before the opening PHP tag in AppController.php and that was the issue. My apologies to anyone who wasted time on this. I just hope this helps someone in the future who clumsily makes the same mistake.

提交回复
热议问题