php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16818 unset doesn't unset session array
Submitted: 2002-04-25 05:12 UTC Modified: 2002-04-30 03:03 UTC
From: dexxter at nothing dot ch Assigned:
Status: Closed Package: Session related
PHP Version: 4.2.0 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dexxter at nothing dot ch
New email:
PHP Version: OS:

 

 [2002-04-25 05:12 UTC] dexxter at nothing dot ch
unsetting several vars saved in a session doesn't work. 
 
eg: 
$HTTP_SESSION_VARS["arr_myfirstarray"] = array("foo","bar"); 
$HTTP_SESSION_VARS["arr_mysecondarray"] = array("foo","bar"); 
 
unset($HTTP_SESSION_VARS["arr_myfirstarray"],$HTTP_SESSION_VARS["arr_mysecondarray"]); 
 
doesn't unset the variables in the session. it does unset them for 
the current script, but doesn't remove them from the SESSION-array 
correctly. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-25 07:46 UTC] yohgaki@php.net
This bug is a kind of design bug, but it's easily fixed.
We need to get rid of PS(vars) and use PS(http_session_vars) as a main session storage. There are some other options, though.

To reporter: You know work around mentioned in the manual, right?
 [2002-04-25 08:19 UTC] dexxter at nothing dot ch
reporter feedback:

do you mean the:
  foreach ($my_array as $element ) {
      unset($element) ;
  }
workaround? or is there any better?
 [2002-04-30 03:03 UTC] dexxter at nothing dot ch
- unset doesn't work as expected if reg_glob is off. setting reg_glob to 'on' makes 
unset working again. only workaround is to dereference if globals are on.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 22:01:33 2024 UTC