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?
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:
- Make sure that you call
session_name
before anything else, includingsession_start
- Make sure there are no periods in your session name (i.e.: don't use "mysite.com" as your session name)
精彩评论