php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27128 session_unset()
Submitted: 2004-02-03 05:57 UTC Modified: 2004-02-04 02:39 UTC
From: dizit at mail dot ru Assigned:
Status: Closed Package: Session related
PHP Version: 4.3.4 OS: Win XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dizit at mail dot ru
New email:
PHP Version: OS:

 

 [2004-02-03 05:57 UTC] dizit at mail dot ru
Description:
------------
Run script below and see next:

BEGIN___________________________________________________
set var=56

session_register("var")

var=56
$GLOBALS["var"] - 56

session_unset()

ATENTION----> var=56
ATENTION----> $GLOBALS["var"] - and gettype($GLOBALS["var"]) is NULL

session_register("another")

ATENTION----> var="another"
___________________________________________________END

If run the script in the Zend Develoment Env. 3.02 Plus and see next result:

BEGIN____________________________________________________
set var=56

session_register("var")

var=56
$GLOBALS["var"] - 56

session_unset()

var=56

$GLOBALS["var"] = 56 and gettype($GLOBALS["var"]) is integer

session_register("another")

var=56
____________________________________________________END


Win XP
Apache 1.3.26
php 4.3.2 and 4.3.4

php.ini
register_globals = On





Reproduce code:
---------------
<?
session_start();

$var=56;
echo '<p>set var=56';

session_register('var');
echo '<p>session_register("var")';

echo '<p>echo var='.$var;
echo '<p>echo $GLOBALS["var"] - '.@$GLOBALS['var'];

session_unset();echo '<p>session_unset()';

echo '<p>echo var='.$var;
echo '<p>echo $GLOBALS["var"] - '.@$GLOBALS['var'].' and gettype($GLOBALS["var"]) is '.gettype(@$GLOBALS['var']);

session_register('another');
echo '<p>session_register("another")';

echo '<p>Once more echo var='.$var;

session_destroy();
?>

Expected result:
----------------

run on PHP Version 4.2.2 and see:

set var=56

session_register("var")

var=56
$GLOBALS["var"] - 56

session_unset()
var=NULL
$GLOBALS["var"] = NULL

session_register("another")

var=NULL



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-03 08:27 UTC] sniper@php.net
The behaviour is correct.
(and hasn't changed since 4.2.2, the output of the script is exactly same with 4.2.2 and 4.3.4)

 [2004-02-04 02:37 UTC] dizit at mail dot ru
Hellow sniper@php.net !!!
Are you looking through text above when write first answer?! Don't confuse people, please.

Text below for other people who have interest to this problem:
----------------------
To next time i wrote the lette to sniper@php.net and then get the next answer: "Get the latest CVS snapshot, this works fine there."
 [2004-02-04 02:39 UTC] dizit at mail dot ru
AND PHP 4.2.2 on Free BSD 4.3
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 05 15:00:01 2025 UTC