php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34887 null variables after session_destroy
Submitted: 2005-10-17 03:12 UTC Modified: 2005-10-17 08:05 UTC
From: dedalo at doramail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.0.5 OS: Linux Fedora Core 4 x86_64
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dedalo at doramail dot com
New email:
PHP Version: OS:

 

 [2005-10-17 03:12 UTC] dedalo at doramail dot com
Description:
------------
I have this code:

session_start();

$_SESSION['myvariable'] = 'Hi all';
$temp = $_SESSION['myvariable'];

session_unset();
session_destroy();

echo $temp;

The output is null.

The variable $temp is not valid more. I think this is a bug because is assigned by value and not by reference.

register_globals is on

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

$_SESSION['myvariable'] = 'Hi all';
$temp = $_SESSION['myvariable'];

session_unset();
session_destroy();

echo $temp;

Expected result:
----------------
Hi all

Actual result:
--------------
null

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-17 03:26 UTC] dedalo at doramail dot com
This is not a bug. I have used session_unset and session_destroy all together.
 [2005-10-17 08:05 UTC] derick@php.net
Not a bug, so we mark it bogus.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Apr 04 08:00:02 2026 UTC