write() abstract public method

Write session data to the backend.
abstract public write ( string $id, string $session_data ) : boolean
$id string The session identifier.
$session_data string The session data.
return boolean True on success, false otherwise.
示例#1
0
 /**
  * Write session data to the backend.
  * This method should only be called internally by PHP via
  * session_set_save_handler().
  *
  * @param string $id            The session identifier.
  * @param string $session_data  The session data.
  *
  * @return boolean  True on success, false otherwise.
  */
 public function write($id, $session_data)
 {
     if ($this->changed || empty($this->_params['no_md5']) && $this->_sig != md5($session_data)) {
         if (!$this->_storage->write($id, $session_data)) {
             $this->_logger->log('Failed to write session data (' . $id . ')', 'DEBUG');
             return false;
         }
         $this->_logger->log('Wrote session data (' . $id . ')', 'DEBUG');
     }
     return true;
 }