开发者

session_name breaks my site?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜