PHP 中的 session.auto_start 有缺点吗? [英] Is there a downside to session.auto_start in PHP?
本文介绍了PHP 中的 session.auto_start 有缺点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通常最终将 session_start()
添加到我的 PHP 站点上每个页面的顶部(或在每个页面中包含的头文件中).我最近发现您可以使用 php.ini
中的以下设置自动启动会话:
I usually end up adding session_start()
to the top of every page on my PHP sites (or in a header file which is in turn included on every page). I recently discovered that you can have sessions start automatically by using the following setting in php.ini
:
session.auto_start = 1
使用此设置有哪些潜在的缺点(如果有)?
What are the potential downsides (if any) of using this setting?
推荐答案
如果您打开会话.auto_start 那么唯一的放置对象的方法进入您的会话是使用加载其类定义auto_prepend_file 在其中加载类定义,否则您将必须serialize() 你的对象和unserialize() 之后.见.
这篇关于PHP 中的 session.auto_start 有缺点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文