为了使用 Session 类,您需要在配置文件中设置加密密钥 [英] In order to use the Session class you are required to set an encryption key in your config file
问题描述
我正在将 codeigniter 从 1.7.2 升级到 2.0.1.
I am in the process of upgrading codeigniter from 1.7.2 to 2.0.1.
一切似乎都很顺利,除了我得到了
Everything seems to have gone ok except I get
为了使用 Session 类,您需要在配置文件中设置加密密钥.
In order to use the Session class you are required to set an encryption key in your config file.
2.0.0/2.0.1 的哪些变化导致了这种情况?
What is the change in 2.0.0/2.0.1 that has caused this?
我需要做哪些改变来解决这个问题.
What change do I need to make to fix this.
进行上述更改会破坏任何东西吗?
Will making said change break anything?
推荐答案
ohai https://www.codeigniter.com/user_guide/libraries/encryption.html :D
他们要求加密密钥的原因是安全性(显然)
The reason they ask for an encryption key is security (obviously)
注意:即使您没有使用加密会话,您也必须在配置文件中设置一个加密密钥,用于帮助防止会话数据操纵. - 来源:https://www.codeigniter.com/user_guide/libraries/sessions.html
此修改不会破坏您的代码.但是从 1.7.2 更新到 2.0.1 时要小心.我建议你备份你的代码:)
This modification won't break your code. But be careful when updating from 1.7.2 to 2.0.1. I suggest you to backup your code :)
顺便说一句,他们在 CI 的 2.0.0 版本中添加了此安全性改进.我不知道他们为什么不在升级指南中提及它:(
BTW they added this security improvement with the 2.0.0 version of CI. I don't know why they don't mention it in their upgrade guide though :(
这篇关于为了使用 Session 类,您需要在配置文件中设置加密密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!