php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6283 cannot destroy session data an unregister session variables
Submitted: 2000-08-21 17:51 UTC Modified: 2000-10-28 23:42 UTC
From: klaus dot habeck at berlin dot de Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.1pl2 OS: Windows NT 4
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: klaus dot habeck at berlin dot de
New email:
PHP Version: OS:

 

 [2000-08-21 17:51 UTC] klaus dot habeck at berlin dot de
Hi folks,

In version 4.0.1pl2 the functions "session_destroy" and "session_unregister" do not work as expected.

If I for example want to destroy unused session data and - after starting a session - try to delete this session there is not reaction (i.e. unlinking the session file).

This function already does not work in earlier releases properly. So I unlink the file with a user function for destroying the session data.

New in version 4.0.1pl2 is a bug in "session_unregister". While this works fine in the betas of php4 the latest version is unable to unregister session variables.

Below you see the code, which is part of a class. This is the code that I used under php4rc2 and that always works fine until php4pl2:

    function Logout($login_url) {
      session_name("HCSESSION");
      session_start();
      $id = session_id();
      $path = session_save_path();
#      session_unregister("HCUSERNAME");
#      session_unregister("HCLASTNAME");
#      session_unregister("HCFIRSTNAME");
#      session_unregister("HCMAILADDRESS");
#      session_unregister("HCEDITMODE");
      session_destroy();
      unlink("$path/sess_$id");
      if (trim($login_url)) { header("Location: $login_url"); exit; }
      return $id; }

For the security of session handling I wood be glad if you can find a solution for this bug.

Thanks a lot Klaus Habeck

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-03 03:04 UTC] waldschrott@php.net
There currently is a bug (#5231)in session_destroy(), are there still any problems with session_unregister()?
 [2000-10-28 23:42 UTC] sniper@php.net
This is fixed in CVS.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 08:01:33 2024 UTC