Menu

#401 Warning: Invalid argument supplied for foreach() in nocc_session.php

Reproducible
closed-fixed
None
5
2014-11-20
2013-11-20
No

Hi,

first of all: This is a very good and well documented project!

I have the following problems:

After testing on my windows host i´ve uploaded the source to a linux based host where i have the following errors:

Warning: Invalid argument supplied for foreach() in /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php on line 116
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php:116) in /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php on line 221
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php:116) in /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php on line 221
Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php:116) in /xxx/xxxxxx/xxxxxxxx/xxxx/utils/proxy.php on line 27
Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php:116) in /xxx/xxxxxx/xxxxxxxx/xxxx/utils/proxy.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxxxxx/xxxxxxxx/xxxx/classes/nocc_session.php:116) in /xxx/xxxxxx/xxxxxxxx/xxxx/html/header.php on line 10

The problem seems to be that there are no files matching the PHP glob() function in public static function remove_old_sessions() and public static function remove_old_session_tmp_file().

My solution was to add the following lines to the source:

Line 116: if (count(glob($conf->prefs_dir.'/'."NOCCLI_")==0)) return;
Line 136: if (count(glob($conf->tmpdir.'/'.$SESSION['sname']."
")==0)) return;

Maybe this could help somebody with the same problems.

Best regards
Oliver

Discussion

  • Oliver Heil

    Oliver Heil - 2014-03-19

    Dear Oliver,

    I confirm this issue. It will be solved in version 1.9.5
    For version 1.9.4 I attache the new file classes/nocc_session.php here and I will commit it into the develop branch.

    Thanks for your help,

    Oli

     
  • Oliver Heil

    Oliver Heil - 2014-03-19
    • status: open --> accepted
    • assigned_to: Oliver Heil
     
  • Oliver Heil

    Oliver Heil - 2014-11-20
    • status: accepted --> closed-fixed
     

Log in to post a comment.