Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 会话类错误,需要codeigniter中的加密密钥_Php_Codeigniter_Session - Fatal编程技术网

Php 会话类错误,需要codeigniter中的加密密钥

Php 会话类错误,需要codeigniter中的加密密钥,php,codeigniter,session,Php,Codeigniter,Session,我是codeigniter的新手,对php有着良好的经验。我最近遇到了一个codeigniter告诉我的错误 "In order to use the Session class you are required to set an encryption key in your config file." 我听说解决办法是粘贴 $config['encryption_key'] = 'your_encryption_key_here'; 在配置文件中 现在我完全不知道这里发生了什么

我是codeigniter的新手,对php有着良好的经验。我最近遇到了一个codeigniter告诉我的错误

 "In order to use the Session class you are required to set an encryption key in your config file." 
我听说解决办法是粘贴

   $config['encryption_key'] = 'your_encryption_key_here';
在配置文件中

现在我完全不知道这里发生了什么。这个加密密钥是什么?为什么课时课需要它?重点是什么

谢谢大家

来自:

注意:即使未使用加密会话,也必须在配置文件中设置加密密钥,该密钥用于帮助防止会话数据操纵

此外,您不需要粘贴任何内容
$config['encryption\u key']
已存在于
config.php
中,但设置为空字符串:

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key.  See the user guide for info.
|
*/
$config['encryption_key'] = '';

我们应该投票否决我们自己在文档中清晰可见的报价:)-您可以使用它生成密钥:)我可以问一下加密密钥的实际意义吗?我对这一切都不熟悉。。对不起。@Matt:从我上面的回答来看,钥匙的作用是帮助防止会话数据被操纵。您可以在。CodeIgniter以其高于平均水平的文档而闻名——我强烈建议您通读它。@Colin Yeah CI文档非常不错。人们仍然忽略了它,不仅是对于原生php函数,人们还忽略了php文档。我猜有些人会变得懒惰,如果他们在视频教程中找不到解决方案,他们会来这里问这些问题。PS无论如何都不是针对马特的。