$ _SESSION / $ HTTP_SESSION_VARS行为 [英] $_SESSION / $HTTP_SESSION_VARS behaviour

查看:59
本文介绍了$ _SESSION / $ HTTP_SESSION_VARS行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将我自己的一些PHP页面与一些现有的代码进行整合。这个细节是针对那个

代码的支持论坛(我一直在问问题),但我想知道是否有人在这里

可以启发我为什么有问题的代码正在产生效果。


由于我不知道的原因,如果PHP版本为5或更高版本,

register_long_arrays为false并且$ _SESSION存在,执行以下

语句:


$ HTTP_SESSION_VARS = $ _SESSION;


这个line正在停止对存储在服务器上的会话文件中的$ _SESSION变量

的任何后续更改 - 更改可以是

,但最终都丢失了页面处理和值

恢复到脚本执行之前的状态。


这是设计的行为吗?为什么会这样?有没有一个标准

为什么有人会包含这样的声明(安全性?)?


我在PHP 5.1.3上看到这种行为/ Win 2003 sp1 / IIS 6和PHP

5.1.6 / Win XP sp2 / Apache 2.


感谢您的帮助!


问候,

迈克

I''ve been trying to integrate some PHP pages of my own with some
existing code. The details of this are for the support forums for that
code (where I have been asking questions), but I wonder if someone here
can enlighten me as to why the problematic code is having the effect it is.

For reasons I don''t know, if the PHP version is 5 or greater,
register_long_arrays is false and $_SESSION exists, the following
statement is executed:

$HTTP_SESSION_VARS = $_SESSION;

This line is stopping any subsequent changes to the $_SESSION variable
from being stored in the session file on the server - changes can be
made, but are all lost at the end of the page processing and the value
reverts to whatever it was before the script was executed.

Is this behaviour by design? Why does it happen? Is there a standard
reason why anyone would include a statement like this (security?)?

I''m seeing this behaviour on PHP 5.1.3 / Win 2003 sp1 / IIS 6 and on PHP
5.1.6 / Win XP sp2 / Apache 2.

Thanks for any help!

Regards,
Mike

推荐答案

_SESSION存在,以下
$执行b $ b语句:

_SESSION exists, the following
statement is executed:


HTTP_SESSION_VARS =
HTTP_SESSION_VARS =


_SESSION;


此行停止对
_SESSION;

This line is stopping any subsequent changes to the


这篇关于$ _SESSION / $ HTTP_SESSION_VARS行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆