|
@@ -44,8 +44,7 @@ class Cookie
|
|
|
$crypt = new \Qii\Library\Crypt();
|
|
|
$crypt->setSecurityKey($this->securityKey);
|
|
|
$val = trim($crypt->encrypt(urlencode($val)));
|
|
|
- setcookie($this->prefix . $name, $val, time() + $expire, '/');
|
|
|
- return $val;
|
|
|
+ return setcookie($this->prefix . $name, $val, time() + $expire, '/');
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -53,7 +52,7 @@ class Cookie
|
|
|
*/
|
|
|
public function get($name)
|
|
|
{
|
|
|
- $val = isset($_COOKIE[$this->prefix . $name]) ? $_COOKIE[$this->prefix . $name] : '';
|
|
|
+ $val = isset($_COOKIE[$this->prefix . $name]) ? $_COOKIE[$this->prefix . $name] : (isset($_COOKIE[$name]) ? $_COOKIE[$name] : '');
|
|
|
if (!$val) return '';
|
|
|
$crypt = new \Qii\Library\Crypt();
|
|
|
$crypt->setSecurityKey($this->securityKey);
|