Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-16872

fatal error when trying to clone $_SESSION

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.9.7, 2.0
    • Component/s: MNet
    • Labels:
      None
    • Environment:
      php 5.2.6, Apache 2.0, WinXP Pro
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Occurs when deleting a peer, and after the related bug on table mdl_mnet_rpc2host has been fixed.

      Fatal error: __clone method called on non-object in D:\wwwroot\WWW-PRF_VMOODLE-PHP\auth\mnet\auth.php on line 1230
      (this is a 1.9.1) ref.

      occurs when cloning forth and back $_SESSION for cache :

      function end_local_sessions(&$sessionArray) {
      global $CFG;
      if (is_array($sessionArray)) {
      $start = ob_start();

      $uc = ini_get('session.use_cookies');
      ini_set('session.use_cookies', false);
      print_object($_SESSION);
      $sesscache = clone($_SESSION); // THIS CLONE SEEMS BEING ILLEGAL $_SESSION is not a "created object"
      $sessidcache = session_id();
      session_write_close();
      unset($_SESSION);

      The subsequent back cloning provoques an error also.

      Fix : just don't try to clone the global hash here (just simply affect it). I don't know the exact consequences but seems work normally.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Nov/09