Bug #70584 [NEW]: Spontanous loss of all $_SESSION variables

From: Date: Fri, 25 Sep 2015 15:40:40 +0000
Subject: Bug #70584 [NEW]: Spontanous loss of all $_SESSION variables
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196246@lists.php.net to get a copy of this message
From:             buschmann at nidsa dot net
Operating system: Windows
PHP version:      7.0.0RC3
Package:          *General Issues
Bug Type:         Bug
Bug description:Spontanous loss of all $_SESSION variables

Description:
------------
We recently ported our php application to a new server and decided to go
productive with php 7.
With surveying the error_logs, we observed the complete loss of all
$_SESSION variables occuring about 1 to 10 times/day, independend of a
specific user or session.
Since elementary configuration data are stored in $_SESSION variables,
the script is unable to connect to the database and falls back to load
the login script again.
The crucial variables are set only once by an include file from
index.php, the login script, and never changed afterwords in the other
scripts.
We didn't observe it in the test phase, and cannot test it with php
5.6.13.
It seems to occur randomly, our suspicion goes to garbage collector or
similar.
Sorry, but we have no expertise in php internals.

Expected result:
----------------
preservation of all $_SESSION variables throughout the session.

Actual result:
--------------
This is a log entry of a successfull login of the user
all SAM_XXXX session variables ar set only once from an include file
only included from index.php (the login screen)

[25-Sep-2015 05:01:22 Europe/Berlin] HB index.php
<hidden_path>\index.php: 103 session_id= 034njrgkpk89k70ac8icqt2ad5
SESSION= Array
(
    [sqlDB] => <hidden_database>
    [SAM_CONNECTION_STRING] => <hidden_access_string>
    [SAM_PDF_TOOL] => ../fpdf/fpdf.php
    [SAM_TFPDF_TOOL] => ../tfpdf/tfpdf.php
    [SAM_TCPDF_TOOL] => ../tcpdf/tcpdf.php
    [SAM_EXDATA_PATH] => <hidden_path>/ExData/
    [SAM_EXDATA_WEB] => /cps/ExData/
    [SAM_COLL_PATH] => <hidden_path>/Collection/
    [SAM_COLL_WEB] => /cps/Collection/
    [SAM_FOTO_PATH] => <hidden_path>/cpsImg/Imgs/
    [SAM_FOTO_WEB] => /cps/cpsImg/Imgs/
    [SAM_IMGS_PATH] => ../fixImg/
    [SAM_IMGS_WEB] => /cps/fixImg/
    [sqlHost] => localhost
    [sqlUs] => postgres
    [sqlPw] => 
    [IUN] => 188
    [UN] => hidden_user
    [TEMP] => 22
    [FI] => 
    [ID] => 
    [OFF] => 3
    [FIL] => 
    [N] => 
    [ORD] => 
    [OPC] => 
    [LAST_DISABLED_SEASON] => 11
    [MAX_RELEVANCE] => 2
    [SAM_DB_TYPE] => PostgreSQL
    [CU] => Array
        (
            [1] => USD
            [2] => EUR
            [3] => CNY
            [4] => GBP
        )
--

After being connected for several hours, we get the following error at
09:46:32
The reason is, that all session variables are gone, except those
initialised at the beginning of MenuPrincipal: 

[25-Sep-2015 09:46:32 Europe/Berlin] HB MAIN_MENU
<hidden_path>\MenuPrincipal.php: 84 session_id=
034njrgkpk89k70ac8icqt2ad5 SESSION= Array
(
    [OPC] => 
    [ID] => 0
    [FIL] => 
    [usAccess] => Array
        (
        )

)


[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_connect():  in
<hidden_path>\MenuPrincipal.php on line 88

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): No
PostgreSQL link opened yet in <hidden_path>\MenuPrincipal.php on line
95

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): supplied
resource is not a valid PostgreSQL link resource in
<hidden_path>\MenuPrincipal.php on line 95

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_fetch_assoc()
expects parameter 1 to be resource, boolean given in
<hidden_path>\MenuPrincipal.php on line 97

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): No
PostgreSQL link opened yet in <hidden_path>\MenuPrincipal.php on line
370

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): supplied
resource is not a valid PostgreSQL link resource in
<hidden_path>\MenuPrincipal.php on line 370

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): No
PostgreSQL link opened yet in <hidden_path>\MenuPrincipal.php on line
373

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_query(): supplied
resource is not a valid PostgreSQL link resource in
<hidden_path>\MenuPrincipal.php on line 373

[25-Sep-2015 09:46:32 Europe/Berlin] PHP Warning:  pg_fetch_assoc()
expects parameter 1 to be resource, boolean given in
<hidden_path>\MenuPrincipal.php on line 380

After checking for no connection, the user is sent the login screen to
log in again.
This loads all the never changed session varialbes SAM_XXXX again from
the include file.

[25-Sep-2015 09:46:47 Europe/Berlin] HB index.php
<hidden_path>\index.php: 103 session_id= 034njrgkpk89k70ac8icqt2ad5
SESSION= Array
(
    [OPC] => 
    [ID] => 
    [FIL] => 
    [usAccess] => Array
        (
        )

    [sqlDB] => <hidden_database>
    [SAM_CONNECTION_STRING] => <hidden_access_string>
    [SAM_PDF_TOOL] => ../fpdf/fpdf.php
    [SAM_TFPDF_TOOL] => ../tfpdf/tfpdf.php
    [SAM_TCPDF_TOOL] => ../tcpdf/tcpdf.php
    [SAM_EXDATA_PATH] => <hidden_path>ExData/
    [SAM_EXDATA_WEB] => /cps/ExData/
    [SAM_COLL_PATH] => <hidden_path>Collection/
    [SAM_COLL_WEB] => /cps/Collection/
    [SAM_FOTO_PATH] => <hidden_path>cpsImg/Imgs/
    [SAM_FOTO_WEB] => /cps/cpsImg/Imgs/
    [SAM_IMGS_PATH] => ../fixImg/
    [SAM_IMGS_WEB] => /cps/fixImg/
    [sqlHost] => localhost
    [sqlUs] => postgres
    [sqlPw] => 
    [IUN] => 188
    [UN] => <hidden_user>
    [TEMP] => 22
    [FI] => 
    [OFF] => 3
    [N] => 
    [ORD] => 
    [comodin] => 
    [LAST_DISABLED_SEASON] => 11
    [MAX_RELEVANCE] => 2
    [SAM_DB_TYPE] => PostgreSQL
    [CU] => Array
        (
            [1] => USD
            [2] => EUR
            [3] => CNY
            [4] => GBP
        )

)


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



Thread (17 messages)

« previous php.bugs (#196246) next »