CakePHP Security::cipher() is not working specifically on server(CakePHP Security::cipher() 不适用于服务器)
问题描述
我在读取加密的 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() 不适用于服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CakePHP Security::cipher() 不适用于服务器
基础教程推荐
- 超薄框架REST服务两次获得输出 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01