Home > Backend Development > PHP Tutorial > The difference between opening and closing session auto_start in phpini

The difference between opening and closing session auto_start in phpini

WBOY
Release: 2016-07-29 09:08:45
Original
2102 people have browsed it

In daily development, php.ini configures session.auto_start=0 by default. When the session is closed by default, if you want to open the session, you need to call session_start:

  • session.auto_start. Session_start() is automatically completed when it is opened
  • Difference It depends on whether session_start() is needed before using SESSION;
  • When session.auto_start = on, execute session_start() will generate a new session_id
  • session.auto_start = on The advantage is that errors will not be caused by forgetting to execute session_start() or not positioning session_start() in the program at any time
  • The disadvantage is that if you are using third-party code, you must delete all session_start() in it. Otherwise, you will not get the correct results

The above introduces the difference between opening and closing session auto_start in phpini, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template