加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

CI框架自动加载session出现报错的解决办法

发布时间:2020-12-12 20:14:34 所属栏目:PHP教程 来源:网络整理
导读:很多程序员在CI中使用session的时候,开启自动加载session之后网站就报错了,具体错误信息如下:In order to use the Session class you are required to set an encryption key 下面一起来看问题解决办法。 提示信息说明: 如果想用session类的话就必须要设

很多程序员在CI中使用session的时候,开启自动加载session之后网站就报错了,具体错误信息如下:In order to use the Session class you are required to set an encryption key

下面一起来看问题解决办法。

提示信息说明:

如果想用session类的话就必须要设置一个加密的密钥

!那就给设置一个吧,毕竟也是出于安全考虑。

打开application/config/config.php找到Encryption Key

代码如下:
/*
|--------------------------------------------------------------------------
| 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'] = 'xxxxx';//在这里加上密钥即可正常!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读