original_string: protected static function export_user_session_data(int $userid, \context $context) {
          global $DB, $SESSION;
  
          $records = $DB->get_records('sessions', ['userid' => $userid]);
          if (!empty($records)) {
              $sessiondata = (object) array_map(function($record) {
                  return [
                      'state' => $record->state,
                      'sessdata' => base64_decode($record->sessdata),
                      'timecreated' => transform::datetime($record->timecreated),
                      'timemodified' => transform::datetime($record->timemodified),
                      'firstip' => $record->firstip,
                      'lastip' => $record->lastip
                  ];
              }, $records);
              writer::with_context($context)->export_data([get_string('privacy:sessionpath', 'user')], $sessiondata);
          }
      }
code: protected static function export_user_session_data(int $userid, \context $context) {
          global $DB, $SESSION;
  
          $records = $DB->get_records('sessions', ['userid' => $userid]);
          if (!empty($records)) {
              $sessiondata = (object) array_map(function($record) {
                  return [
                      'state' => $record->state,
                      'sessdata' => base64_decode($record->sessdata),
                      'timecreated' => transform::datetime($record->timecreated),
                      'timemodified' => transform::datetime($record->timemodified),
                      'firstip' => $record->firstip,
                      'lastip' => $record->lastip
                  ];
              }, $records);
              writer::with_context($context)->export_data([get_string('privacy:sessionpath', 'user')], $sessiondata);
          }
      }
code_tokens: protected static function export_user_session_data ( int $ userid , \ context $ context ) { global $ DB , $ SESSION ; $ records = $ DB -> get_records ( 'sessions' , [ 'userid' => $ userid ] ) ; if ( ! empty ( $ records ) ) { $ sessiondata = ( object ) array_map ( function ( $ record ) { return [ 'state' => $ record -> state , 'sessdata' => base64_decode ( $ record -> sessdata ) , 'timecreated' => transform :: datetime ( $ record -> timecreated ) , 'timemodified' => transform :: datetime ( $ record -> timemodified ) , 'firstip' => $ record -> firstip , 'lastip' => $ record -> lastip ] ; } , $ records ) ; writer :: with_context ( $ context ) -> export_data ( [ get_string ( 'privacy:sessionpath' , 'user' ) ] , $ sessiondata ) ; } }
docstring: Exports information about the user's session.
  
  @param  int $userid The user ID.
  @param  \context $context The context for this user.
docstring_tokens: Exports information about the user s session .