开发者

CakePHP Security::cipher() is not working specifically on server

开发者 https://www.devze.com 2023-03-07 19:23 出处:网络
I\'m having a problem with reading the encrpyted cookie. Debugging revealed that Security::cipher() on server is somehow broken. Is there anyway I could solve it?

I'm having a problem with reading the encrpyted cookie. Debugging revealed that Security::cipher() on server is somehow broken. Is there anyway I could solve it?

Below is the breakdown.

Code

$value = "Hello World";
$key = Configure::read('Security.salt');

$val = Security::cipher($value, $key);
debug($val);
$ret = Security::cipher($val, $key);
debug($ret);

Local

app\views\pages\home.ctp (line 17)
�J��WtJ0�

app\views\pages\home.ctp (line 19)
Hello Worl开发者_开发问答d

Server

app/views/pages/home.ctp (line 17)
x�.��9v��

app/views/pages/home.ctp (line 19)
�{�U��g��O


Security::cipher() is using srand() function which is disabled by suhosin module which comes as default for many Apache, PHP servers.

Disable suhosin and Security::cipher() will work fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号