In PHP, is there any harm in running session_start() multiple times?

前端 未结 7 859
臣服心动
臣服心动 2020-12-03 13:37

Presumably there\'s some tiny performance hit, but beyond that?

7条回答
  •  暖寄归人
    2020-12-03 13:42

    Reading the docs for session_start, all I can see is:

    As of PHP 4.3.3, calling session_start() after the session was previously started will result in an error of level E_NOTICE. Also, the second session start will simply be ignored.

    So, you'll get an E_NOTICE and be ignored.

提交回复
热议问题