public function write($id , $data) {
    $crypto = $this->psl['crypt/crypto'];
    $store  = $this->psl['store'];

    /* Encrypt session. */
    try {
      $crypto->_algo = $this->cryptAlgo;
      $crypto->_mode = $this->cryptMode;
      $encrypted = $crypto->encrypt($data, $this->secret);

      /* Destroy old session. */
      if($this->newID != $this->currID) {
        $this->destroy($this->currID);
      }

      /* Write new session, with new ID. */
      return $store->write('session', $this->newID, $encrypted);
    } catch (\phpSec\Exception $e) {
      return false;
    }
  }
public function write($id , $data) {
    $crypto = $this->psl['crypt/crypto'];
    $store  = $this->psl['store'];

    /* Encrypt session. */
    try {
      $crypto->_algo = $this->cryptAlgo;
      $crypto->_mode = $this->cryptMode;
      $encrypted = $crypto->encrypt($data, $this->secret);

      /* Destroy old session. */
      if($this->newID != $this->currID) {
        $this->destroy($this->currID);
      }

      /* Write new session, with new ID. */
      return $store->write('session', $this->newID, $encrypted);
    } catch (\phpSec\Exception $e) {
      return false;
    }
  }
public function write ( $ id , $ data ) { $ crypto = $ this -> psl [ 'crypt/crypto' ] ; $ store = $ this -> psl [ 'store' ] ; /* Encrypt session. */ try { $ crypto -> _algo = $ this -> cryptAlgo ; $ crypto -> _mode = $ this -> cryptMode ; $ encrypted = $ crypto -> encrypt ( $ data , $ this -> secret ) ; /* Destroy old session. */ if ( $ this -> newID != $ this -> currID ) { $ this -> destroy ( $ this -> currID ) ; } /* Write new session, with new ID. */ return $ store -> write ( 'session' , $ this -> newID , $ encrypted ) ; } catch ( \ phpSec \ Exception $ e ) { return false ; } }
Encrypt and save a session.

@param string $id
@param string $data
@return bool
Encrypt and save a session .