CakePHP Security :: cipher () does not work specifically on the server

I am having trouble reading the encrpyted cookie. Debugging showed that Security :: cipher () on the server will somehow break. Anyway, can I solve this?

Below is a breakdown.

the 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 World

Server

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

app/views/pages/home.ctp (line 19)
 { U  g  O
+3
source share
1 answer

Security :: cipher () uses the srand () function, which is disabled by the suhosin module, which is used by default for many Apache, PHP servers.

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

0
source

All Articles