Bug #16299 Updated: session don't save data with global_vars=off
| From: | cesar at fastlink dot com dot uy | Date: | Thu, 28 Mar 2002 03:17:18 +0000 |
| Subject: | Bug #16299 Updated: session don't save data with global_vars=off | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-3542@lists.php.net to get a copy of this message | ||
ID: 16299
Updated by: cesar@fastlink.com.uy
-Summary: session no save data with global_vars=off
Reported By: cesar@fastlink.com.uy
Status: Bogus
Bug Type: Session related
Operating System: win98-redhat7.2
PHP Version: 4.1.2
New Comment:
If global_vars=off, the superglobal array($_SESSION) don't save my data
for new request.
Thanks. cesar
Tested in Win98-PWS4-PHP4.1.2 and RedHat7.2-Apache1.3-PHP406
I give 2 examples.
//THIS EXAMPLE DON'T WORK - idem with $HTTP_SESSION_VARS
session_start();
!isset($_SESSION['count']) ? $_SESSION['count'] = 0 :
$_SESSION['count']++;
echo $_SESSION['count'];
===============================================
//THIS EXAMPLE WORK
session_start();
if(!session_is_registered('count')){
session_register('count');
$count = 0;
}else{
$count++;
}
echo $count;
Previous Comments:
------------------------------------------------------------------------
[2002-03-27 06:33:07] sander@php.net
Please report in ENGLISH.
------------------------------------------------------------------------
[2002-03-26 22:56:50] cesar@fastlink.com.uy
Tengo la siguiente duda sobre el manejo de sesiones en php4, todo
funciona muy bien cuando habilito las variables globales en el php.ini,
pero cuando las pongo en off, no funciona. Agradezco su revision.
Saludos y gracias. cesar
Ahh por cierto estas pruebas la realize en:
Win98-PWS4-PHP4.1.2 y en RedHat7.2-Apache1.3-PHP406
Les paso 2 ejemplos en uno NO funciona y en otro si.
session_start(); //EJEMPLO QUE NO FUNCIONA
!isset($_SESSION['count']) ? $_SESSION['count'] = 0 :
$_SESSION['count']++; // idem con $HTTP_SESSION_VARS
echo $_SESSION['count'];
===============================================
session_start(); //EJEMPLO QUE FUNCIONA
if(!session_is_registered('count')){
session_register('count');
$count = 0;
}else{
$count++;
}
echo $count;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16299&edit=1