Bug #71088 [Com]: Session gets corrupted using custom session handler, unicode chars + 2 pg_conn

From: Date: Fri, 11 Dec 2015 13:13:24 +0000
Subject: Bug #71088 [Com]: Session gets corrupted using custom session handler, unicode chars + 2 pg_conn
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197789@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71088&edit=1 ID: 71088 Comment by: mattw at epiphanycardio dot com Reported by: cdutary at grupocti dot com Summary: Session gets corrupted using custom session handler, unicode chars + 2 pg_conn Status: Open Type: Bug Package: Session related Operating System: Windows 2008 PHP Version: 7.0.0 Block user comment: N Private report: N New Comment: We have experienced a very similar issue using php 5.6.x It appeared with 5.6.12, 5.6.11 was fine. We use mysql for the custom handler. I inserted debugging into the session handler and discovered an extra session_destroy is called implicitly by the session handler. I have turned off all explicit session_destroy() php function calls, yet a session_destroy is still being called. Previous Comments: ------------------------------------------------------------------------ [2015-12-11 05:53:12] cdutary at grupocti dot com Description: ------------ PHP: VC14 x64 Thread Safe (2015-Dec-03 20:07:26) To reproduce this problem we need 3 elements: - A custom session handler using postgres - Unicode characters inside our session variable. - A seccond postgres connection made when the session has ben started. So what happends is: The session gets corrupt at the end of the script when these 3 elements are present, throwing: "PHP Warning: session_start(): Failed to decode session object. Session has been destroyed in some location at some line" when you reload the page. Reloading the page once more will give you: PHP Warning: pg_fetch_result(): Unable to jump to row 0 on PostgreSQL result index something in some path: If we take the seccond postgres connection OUT of the equation then session data will remain untouched. So just comment that line and watch the page reload and reload over time. Uncomment the seccond connection and it will crash. Test script: --------------- This code is about 50 lines and you shall download it from: https://grupocti.com/sesiones.txt Just fill in 2 diffrent pg_conn. A StackOverflow question is also open and contains all the details: http://stackoverflow.com/questions/34185536/php7-is-breaking-my-sessions-when-custom-session-handler-is-used-and-a-seccond-p ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71088&edit=1

« previous php.bugs (#197789) next »