public function decryptSecureCookie($value)
    {
        $cookieValues = explode('|', $value, 4);
        if ((count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time())) {
            $userid = $cookieValues[0];
            $expire = $cookieValues[1];
            $encrValue = $cookieValues[2];

            $key = hash_hmac('sha1', $userid.$expire, $this->key);
            $value = $this->decrypt(base64_decode(str_replace(' ', '+', $encrValue)), md5($expire));

            if ($this->includeSSLKey == true && ($sslKey = $this->Request->getServerAttribute('SSL_SESSION_ID')))
                $verifyKey = hash_hmac('sha1', $userid . $expire . $value . $sslKey, $key);
            else
                $verifyKey = hash_hmac('sha1', $userid . $expire . $value, $key);

            if (strcmp($verifyKey, $cookieValues[3]) === 0)
                return $value;
        }
        return false;
    }
public function decryptSecureCookie($value)
    {
        $cookieValues = explode('|', $value, 4);
        if ((count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time())) {
            $userid = $cookieValues[0];
            $expire = $cookieValues[1];
            $encrValue = $cookieValues[2];

            $key = hash_hmac('sha1', $userid.$expire, $this->key);
            $value = $this->decrypt(base64_decode(str_replace(' ', '+', $encrValue)), md5($expire));

            if ($this->includeSSLKey == true && ($sslKey = $this->Request->getServerAttribute('SSL_SESSION_ID')))
                $verifyKey = hash_hmac('sha1', $userid . $expire . $value . $sslKey, $key);
            else
                $verifyKey = hash_hmac('sha1', $userid . $expire . $value, $key);

            if (strcmp($verifyKey, $cookieValues[3]) === 0)
                return $value;
        }
        return false;
    }
public function decryptSecureCookie ( $ value ) { $ cookieValues = explode ( '|' , $ value , 4 ) ; if ( ( count ( $ cookieValues ) === 4 ) && ( $ cookieValues [ 1 ] == 0 || $ cookieValues [ 1 ] >= time ( ) ) ) { $ userid = $ cookieValues [ 0 ] ; $ expire = $ cookieValues [ 1 ] ; $ encrValue = $ cookieValues [ 2 ] ; $ key = hash_hmac ( 'sha1' , $ userid . $ expire , $ this -> key ) ; $ value = $ this -> decrypt ( base64_decode ( str_replace ( ' ' , '+' , $ encrValue ) ) , md5 ( $ expire ) ) ; if ( $ this -> includeSSLKey == true && ( $ sslKey = $ this -> Request -> getServerAttribute ( 'SSL_SESSION_ID' ) ) ) $ verifyKey = hash_hmac ( 'sha1' , $ userid . $ expire . $ value . $ sslKey , $ key ) ; else $ verifyKey = hash_hmac ( 'sha1' , $ userid . $ expire . $ value , $ key ) ; if ( strcmp ( $ verifyKey , $ cookieValues [ 3 ] ) === 0 ) return $ value ; } return false ; }
Retrieve a secured cookie value

@param string $value The secured value

@return string the value stored in the secured cookie or false if unsuccessful
Retrieve a secured cookie value