php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4842 session errors with exit in write function
Submitted: 2000-06-06 20:04 UTC Modified: 2000-07-11 05:46 UTC
From: abush at microcenter dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.0 Release OS: RedHat 6.1
Private report: No CVE-ID: None
 [2000-06-06 20:04 UTC] abush at microcenter dot com
Compiled php4.0.0 into apache_1.3.12.

If an exit is placed inside of the "write" function which is initialized with session_set_save_handler() the following error is printed continuously.

Fatal error: ht=08193b64 is already destroyed in zend_hash.c:519 in Unknown on line 0

example:
<!-- include.inc -->
...
Function sess_write($key, $val) {
  exit;
}
...
session_set_save_handler(
    "sess_open",
    "sess_close",
    "sess_read",
    "sess_write",
    "sess_destroy",
    "sess_gc");

session_name($SESSION_NAME);

session_set_cookie_params($SESS_LIFE);
<!-- end include.inc -->

<!-- session.phtml -->
require('include.inc');
session_start();
session_register(session);

$session[count]++;
print "$session[count]";
<!-- end session.phtml -->

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-11 05:46 UTC] sas at cvs dot php dot net
This happens, because you simply jump out in the middle of a large process. That is not a problem though, the memory layer will take care of it.

The write handler shall return false upon a failed write attempt. 
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 05:05:50 2023 UTC