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

Odd code in sessionlib.php handler_write function

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3
    • Fix Version/s: 2.4
    • Component/s: Other
    • Labels:

      Description

      Whilst looking through the file sessionlib.php in function 'handler_write' to track down a crash during backup, I came across the following lines of code:
      if (isset($this->record->id)) {
      $record = new stdClass();
      $record->state = 0;
      $record->sid = $sid; // might be regenerating sid
      $this->record->sessdata = base64_encode($session_data); // there might be some binary mess
      $this->record->userid = $userid;
      $this->record->timemodified = time();
      $this->record->lastip = getremoteaddr();

      The $record variable does not appear to be referenced again in this function, which means that the 'state' and 'sid' values don't seem to be doing anything. This may not be a problem (as the session handling seems to be working), but I thought it worth flagging up, in case something had been missed.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/12