2013-11-17 09:36:50 10219次浏览 4条回答 0 悬赏 10 金钱

用yii做的媒体后台,用admin登录,不成功。显示如下。求助。

PHP warningsession_regenerate_id() [<a href="function.session-regenerate-id">function.session-regenerate-id</a>]: Session object destruction failed</p><p>&nbsp;D:\apache\htdocs\game\yii\framework\web\CHttpSession.php(185)</p><p></p><pre>  {
<span class="ln">174</span>         session_id($value);
<span class="ln">175</span>     }
<span class="ln">176</span> 
<span class="ln">177</span>     /**
<span class="ln">178</span>      * Updates the current session id with a newly generated one .
<span class="ln">179</span>      * Please refer to { http://php.net/session_regenerate_id} for more details.
<span class="ln">180</span>      * @param boolean $deleteOldSession Whether to delete the old associated session file or not.
<span class="ln">181</span>      * @since 1.1.8
<span class="ln">182</span>      */
<span class="ln">183</span>     public function regenerateID($deleteOldSession=false)
<span class="ln">184</span>     {
<span class="error"><span class="ln error-ln">185</span>         session_regenerate_id($deleteOldSession);
</span><span class="ln">186</span>     }
<span class="ln">187</span> 
<span class="ln">188</span>     /**
<span class="ln">189</span>      * @return string the current session name
<span class="ln">190</span>      */
<span class="ln">191</span>     public function getSessionName()
<span class="ln">192</span>     {
<span class="ln">193</span>         return session_name();
<span class="ln">194</span>     }
<span class="ln">195</span> 
<span class="ln">196</span>     /**
<span class="ln">197</span>      * @param string $value the session name for the current session, must be an alphanumeric string, defaults to PHPSESSID</pre><h2>Stack Trace</h2><table style="width:100%;"><tbody><tr class="trace core collapsed"><td class="number">#0</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CHttpSession.php(185): <strong>session_regenerate_id</strong>(true)				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#1</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\auth\CWebUser.php(708): <strong>CHttpSession</strong>-&gt;<strong>regenerateID</strong>(true)				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#2</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\auth\CWebUser.php(227): <strong>CWebUser</strong>-&gt;<strong>changeIdentity</strong>(&quot;admin&quot;, &quot;admin&quot;, array()) &nbsp; &nbsp;</div></td></tr></tbody></table><table style="width:100%;"><tbody><tr class="trace app expanded"><td class="number">&nbsp;</td><td class="content"><div class="trace-file"><div class="minus">–</div>&nbsp;D:\apache\htdocs\game\m2\protected\models\LoginForm.php(71): <strong>CWebUser</strong>-&gt;<strong>login</strong>(UserIdentity, 0)				</div><div class="code"><pre><span class="ln">66</span>             $this-&gt;_identity-&gt;authenticate();
<span class="ln">67</span>         }
<span class="ln">68</span>         if($this-&gt;_identity-&gt;errorCode===UserIdentity::ERROR_NONE)
<span class="ln">69</span>         {
<span class="ln">70</span>             $duration=$this-&gt;rememberMe ? 3600*24*30 : 0; // 30 days
<span class="error"><span class="ln error-ln">71</span>             Yii::app()-&gt;user-&gt;login($this-&gt;_identity,$duration);
</span><span class="ln">72</span>             return true;
<span class="ln">73</span>         }
<span class="ln">74</span>         else
<span class="ln">75</span>             return false;
<span class="ln">76</span>     }
</pre></div></td></tr></tbody></table><table style="width:100%;"><tbody><tr class="trace app expanded"><td class="number">#4</td><td class="content"><div class="trace-file"><div class="minus">–</div>&nbsp;D:\apache\htdocs\game\m2\protected\controllers\SiteController.php(88): <strong>LoginForm</strong>-&gt;<strong>login</strong>()				</div><div class="code"><pre><span class="ln">83</span>         // collect user input data
<span class="ln">84</span>         if(isset($_POST['LoginForm']))
<span class="ln">85</span>         {
<span class="ln">86</span>             $model-&gt;attributes=$_POST['LoginForm'];
<span class="ln">87</span>             // validate user input and redirect to the previous page if valid
<span class="error"><span class="ln error-ln">88</span>             if($model-&gt;validate() &amp;&amp; $model-&gt;login())
</span><span class="ln">89</span>                 $this-&gt;redirect(Yii::app()-&gt;user-&gt;returnUrl);
<span class="ln">90</span>         }
<span class="ln">91</span>         // display the login form
<span class="ln">92</span>         $this-&gt;render('login',array('model'=&gt;$model));
<span class="ln">93</span>     }
</pre></div></td></tr></tbody></table><table style="width:100%;"><tbody><tr class="trace core collapsed"><td class="number">#5</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\actions\CInlineAction.php(49): <strong>SiteController</strong>-&gt;<strong>actionLogin</strong>()				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#6</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CController.php(308): <strong>CInlineAction</strong>-&gt;<strong>runWithParams</strong>(array(&quot;r&quot; =&gt; &quot;site/login&quot;))				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#7</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CController.php(286): <strong>CController</strong>-&gt;<strong>runAction</strong>(CInlineAction)				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#8</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CController.php(265): <strong>CController</strong>-&gt;<strong>runActionWithFilters</strong>(CInlineAction, array())				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#9</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CWebApplication.php(282): <strong>CController</strong>-&gt;<strong>run</strong>(&quot;login&quot;)				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#10</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\web\CWebApplication.php(141): <strong>CWebApplication</strong>-&gt;<strong>runController</strong>(&quot;site/login&quot;)				</div><div class="code"></div></td></tr><tr class="trace core collapsed"><td class="number">#11</td><td class="content"><div class="trace-file"><div class="plus">+</div>&nbsp;D:\apache\htdocs\game\yii\framework\base\CApplication.php(169): <strong>CWebApplication</strong>-&gt;<strong>processRequest</strong>()				</div><div class="code"></div></td></tr><tr class="trace app expanded"><td class="number">#12</td><td class="content"><div class="trace-file"><div class="minus">–</div>&nbsp;D:\apache\htdocs\game\m2\index.php(13): <strong>CApplication</strong>-&gt;<strong>run</strong>()				</div><div class="code"><pre><span class="ln">08</span> defined('YII_DEBUG') or define('YII_DEBUG',true);
<span class="ln">09</span> // specify how many levels of call stack should be shown in each log message
<span class="ln">10</span> defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
<span class="ln">11</span> 
<span class="ln">12</span> require_once($yii);
<span class="error"><span class="ln error-ln">13</span> Yii::createWebApplication($config)-&gt;run();
</span></pre></div></td></tr></tbody></table>
您需要登录后才可以回答。登录 | 立即注册
yii1234
实习生

yii1234

注册时间:2013-11-17
最后登录:2013-12-14
在线时长:1小时50分
  • 粉丝0
  • 金钱0
  • 威望0
  • 积分10

热门问题