Example #1
0
 /**
  * Get session name
  *
  * @return  string  The session name
  *
  * @since   11.1
  */
 public function getName()
 {
     if ($this->_state === 'destroyed') {
         // @TODO : raise error
         return null;
     }
     return $this->_handler->getName();
 }
Example #2
0
 /**
  * Create a token-string
  *
  * @param   integer  $length  Length of string
  *
  * @return  string  Generated token
  *
  * @since   11.1
  */
 protected function _createToken($length = 32)
 {
     static $chars = '0123456789abcdef';
     $max = strlen($chars) - 1;
     $token = '';
     $name = $this->_handler->getName();
     for ($i = 0; $i < $length; ++$i) {
         $token .= $chars[rand(0, $max)];
     }
     return md5($token . $name);
 }