开发者

session_name breaks my site?

开发者 https://www.devze.com 2023-03-30 16:20 出处:网络
After reading through the PHP manual, I added session_name(\'mysite\'); to my code to ensure that collisions between sessions won\'t happen if I will run multiple apps in the future.

After reading through the PHP manual, I added session_name('mysite'); to my code to ensure that collisions between sessions won't happen if I will run multiple apps in the future.

Unfortunately the session_name()-function call it kills my site completely . A fatal error is thrown (which 开发者_开发技巧appears in the error logs, but doesn't say anything!) and the below error is shown in the browser:

I have PHP-FPM running along with suhosin+nginx at a freshly installed Ubuntu VM. What am I doing wrong?

session_name breaks my site?


As pointed out in the comments on the session_name doc page, there are some issues w/ session_name that can cause your site to break:

  1. Make sure that you call session_name before anything else, including session_start
  2. Make sure there are no periods in your session name (i.e.: don't use "mysite.com" as your session name)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号