|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2006-06-30 03:57 UTC] corey at motionworks dot com dot my
 Description:
------------
Using any of the following date functions inside a custom session handler function causes PHP (and associated Apache thread) to crash. Currently using PHP-CGI.
Functions:
date()
strtotime()
date_default_timezone_get()
time() - Works and doesnt't cause a crash
Reproduce code:
---------------
function sess_open($strSavePath, $strSessionName)
{
    return true;
}
function sess_close()
{
    return true;
}
function sess_read($strKey)
{
    return '';
}
function sess_write($strKey, $strVal)
{
    $strDate = date('d/m/Y H:i:s');
    return true;
}
function sess_destroy($strKey)
{
    return true;
}
function sess_gc($intMaxLifetime)
{
    return true;
}
session_set_save_handler(
            'sess_open',
            'sess_close',
            'sess_read',
            'sess_write',
            'sess_destroy',
            'sess_gc');
session_start();
sess_write('foo', 'bar');
Expected result:
----------------
It not to crash :-)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
I have installed the MVC and the call stack is: PHP5TS! 1009c95f() The exact error message is: "Unhandled exception in php-cgi.exe (PHP5TS.DLL): 0xC0000005: Access Violation" I dont think this is helpful :-) Please note the code above should be: $_SESSION['foo'] = 'bar'; instead of: sess_write('foo', 'bar');