public function saveToken($tokenName = '') { if (empty($this->token[$tokenName])) { $this->token[$tokenName] = $this->getToken($tokenName); if (empty($this->token[$tokenName])) { $this->token[$tokenName] = WindSecurity::generateGUID(); WindCookie::set($tokenName, $this->token[$tokenName], false, null, null, null, false, true); } } return $this->token[$tokenName]; }
public function saveToken($tokenName = '') { if ($this->token === null) { /* @var $tokenContainer IWindHttpContainer */ $tokenContainer = $this->_getTokenContainer(); $tokenName = $this->getTokenName($tokenName); if ($tokenContainer->isRegistered($tokenName)) { $_token = $tokenContainer->get($tokenName); } else { $_token = WindSecurity::generateGUID(); $tokenContainer->set($tokenName, $_token); } $this->token = $_token; } return $this->token; }