Home >Backend Development >PHP Tutorial >【PHP】session.auto_start

【PHP】session.auto_start

WBOY
WBOYOriginal
2016-06-23 14:35:581764browse

      最近在写PHP程序的时候碰到这样一个问题:程序在本地运行正常,但传到服务器上session不起作用了,经仔细寻找,终于发现问题症结所在。原来是php.ini文件中的session.auto_start在作怪。本地的session.auto_start默认为1,表示开启状态,但现在大部分的服务器上该项的值为0。具体解决办法为:在所有使用session的页面前添加session_start();即可。

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
Previous article:php规范Next article:Zend Studio PHP