clq

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

$_SESSION 无效请调用 Session_start

不调用的话时好时坏. 而且是要在每个使用的页面中都调用.要不就要在 php.ini 中设置 session.auto_start is set to 1

--------------------------------------------------

注: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.

--------------------------------------------------

Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site.

A visitor accessing your web site is assigned an unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.

The session support allows you to register arbitrary numbers of variables to be preserved across requests. When a visitor accesses your site, PHP will check automatically (if session.auto_start is set to 1) or on your request (explicitly through session_start() or implicitly through session_register()) whether a specific session id has been sent with the request. If this is the case, the prior saved environment is recreated.

--------------------------------------------------

实际上还有其他的一些限制,具体看 php 的文档吧.

session.auto_start is set to 1

posted on 2012-01-21 15:55  clq  阅读(742)  评论(1编辑  收藏  举报