session problem

WBOY
WBOYOriginal
2016-10-11 14:23:52947browse

How to encapsulate session and cookies in native PHP? It is too troublesome to write session_start(); for every page.

Reply content:

How to encapsulate session and cookies in native PHP? It is too troublesome to write session_start(); for every page.

Can be found in the unified entry file @session_start();
or modify the php.ini configuration file
(if not, add it), modify it to:

<code>session.auto_start = On  # 默认自动开启session</code>

Using single-entry mode, all requests are forwarded through a PHP. All popular frameworks use single-entry mode.

Statement:
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