<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="解决CodeIgniter（CI）框架自动加载session出现报错（In order to use the Session class you are required to set an encryption key）的办法" id="card1">
<p> 游客</p><p>
标题:解决CodeIgniter（CI）框架自动加载session出现报错（In order to use the Session class you are required to set an encryption key）的办法<br/>
正文:<br/>
很多程序员在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代码如下:/*<br/>|--------------------------------------------------------------------------<br/>| Encryption Key<br/>|--------------------------------------------------------------------------<br/><br/>| If you use the Encryption class or the Session class you<br/>| MUST set an encryption key.  See the user guide for info.<br/><br/>*/<br/>$config['encryption_key'] = 'xxxxx';//在这里加上密钥即可正常！<br/><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1523&amp;Page=1">[&lt;&lt;]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1523&amp;Page=1">[[1]]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1523&amp;Page=1">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=1523">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=1523">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://camnpr.com/wap.asp">首页</a>
</p>
</card>
</wml>