original_string: protected static function add_session_record($userid) {
          global $DB;
          $record = new \stdClass();
          $record->state       = 0;
          $record->sid         = session_id();
          $record->sessdata    = null;
          $record->userid      = $userid;
          $record->timecreated = $record->timemodified = time();
          $record->firstip     = $record->lastip = getremoteaddr();
  
          $record->id = $DB->insert_record('sessions', $record);
  
          return $record;
      }
code: protected static function add_session_record($userid) {
          global $DB;
          $record = new \stdClass();
          $record->state       = 0;
          $record->sid         = session_id();
          $record->sessdata    = null;
          $record->userid      = $userid;
          $record->timecreated = $record->timemodified = time();
          $record->firstip     = $record->lastip = getremoteaddr();
  
          $record->id = $DB->insert_record('sessions', $record);
  
          return $record;
      }
code_tokens: protected static function add_session_record ( $ userid ) { global $ DB ; $ record = new \ stdClass ( ) ; $ record -> state = 0 ; $ record -> sid = session_id ( ) ; $ record -> sessdata = null ; $ record -> userid = $ userid ; $ record -> timecreated = $ record -> timemodified = time ( ) ; $ record -> firstip = $ record -> lastip = getremoteaddr ( ) ; $ record -> id = $ DB -> insert_record ( 'sessions' , $ record ) ; return $ record ; }
docstring: Insert new empty session record.
  @param int $userid
  @return \stdClass the new record
docstring_tokens: Insert new empty session record .