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

From: Date: Fri, 11 Dec 2015 05:53:16 +0000
Subject: Bug #71088 [NEW]: Session gets corrupted using custom session handler, unicode chars + 2 pg_conn
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197782@lists.php.net to get a copy of this message
From:             cdutary at grupocti dot com
Operating system: Windows 2008
PHP version:      7.0.0
Package:          Session related
Bug Type:         Bug
Bug description:Session gets corrupted using custom session handler, unicode chars + 2 pg_conn

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 bug report at https://bugs.php.net/bug.php?id=71088&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71088&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71088&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71088&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71088&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71088&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71088&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71088&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71088&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71088&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71088&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71088&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71088&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71088&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71088&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71088&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71088&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71088&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71088&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71088&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71088&r=mysqlcfg



Thread (10 messages)

« previous php.bugs (#197782) next »