我在读取加密的 cookie 时遇到问题.调试显示服务器上的 Security::cipher() 以某种方式损坏.反正我能解决吗?
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?
下面是细分.
代码
$value = "Hello World";
$key = Configure::read('Security.salt');
$val = Security::cipher($value, $key);
debug($val);
$ret = Security::cipher($val, $key);
debug($ret);
本地
appviewspageshome.ctp (line 17)
�J��WtJ0�
appviewspageshome.ctp (line 19)
Hello World
服务器
app/views/pages/home.ctp (line 17)
x�.��9v��
app/views/pages/home.ctp (line 19)
�{�U��g��O
Security::cipher() 正在使用 srand() 函数,该函数被 suhosin 模块禁用,该模块默认用于许多 Apache、PHP 服务器.
Security::cipher() is using srand() function which is disabled by suhosin module which comes as default for many Apache, PHP servers.
禁用 suhosin 和 Security::cipher() 将正常工作.
Disable suhosin and Security::cipher() will work fine.
这篇关于CakePHP Security::cipher() 不适用于服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
不能使用 'Object 作为类名,因为它是保留的Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作为类名,因为它是保留的 Cake 2.2.x)
OAuth 重定向后会话丢失Session is lost after an OAuth redirect(OAuth 重定向后会话丢失)
Cakephp 3.x 中的分页排序Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分页排序)
CakePHP 多个应用程序的共享核心CakePHP Shared core for multiple apps(CakePHP 多个应用程序的共享核心)
在 CakePHP 3 上登录 [ Auth->identify() ] 始终为 falLogin [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登录 [ Auth-identify() ] 始终为 false)
致命错误:允许的内存大小为 134217728 字节已用尽Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命错误:允许的内存大小为 134217728 字节已用尽