如何在Slim Framework中获取加密的散列字符串。我用过:
$app = new \Slim\Slim(array(
'cookies.encrypt' => true,
'cookies.secret_key' => 'MY_SECRET_KEY',
'cookies.cipher' => MCRYPT_RIJNDAEL_256,
'cookies.cipher_mode' => MCRYPT_MODE_CBC
));
$app->setCookie('_hsio', "My Data", '1 day');
$app->getCookie('_hsio');
以上$app->getCookie('_hsio');
将返回解密数据,但我想获取由setCookie
设置的加密哈希字符串。知道怎么做吗?
答案 0 :(得分:1)
你可以从Request对象中获取它:
$app->request->cookies->get('_hsio');