问题描述
会话数据在PHP版本4.4.1中丢失了以前工作在
版本4.3.3
代码类似于下面
假设文件名为count.php,需要参数
productid;
session_start() ;
if(!isset($ _ SESSION [''countAccess'']))$ _SESSION [''countAccess''] = 0;
else $ _SESSION [' 'countAccess''] ++;
echo $ _SESSION [''countAccess''];
如果我用参数调用脚本例如<当我按下刷新按钮$ _SESSION [''countAccess'']时,
count.php?productid = 78
递增但如果我在没有参数的情况下调用它,
$ _SESSION [''countAccess'']会增加。
如果我调用另一个脚本,我也会丢失数据。
有谁知道这里发生了什么?
谢谢
Session data is getting lost in PHP version 4.4.1 which used to work in
version 4.3.3
The code is similar to the one below
Assume the file is called count.php which requires a parameter
productid;
session_start();
if (!isset($_SESSION[''countAccess''])) $_SESSION[''countAccess''] = 0;
else $_SESSION[''countAccess'']++;
echo $_SESSION[''countAccess''];
if I call the script with a parameter for example
count.php?productid=78
when I press refresh button $_SESSION[''countAccess''] does not get
incremented but if I call it without the parameter,
$_SESSION[''countAccess''] gets incremented.
I am also losing data if I call another script.
Does anyone know what''s going on here?
Thank you
这篇关于会话数据丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!