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

fatal error when trying to clone $_SESSION

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.1
    • 1.9.7, 2.0
    • MNet
    • None
    • php 5.2.6, Apache 2.0, WinXP Pro
    • MySQL
    • MOODLE_19_STABLE
    • 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.

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              vf Valery Fremaux
              Andrew Davis Andrew Davis
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Nov/09