常见magento问题三----magento后台无法登陆

后台的用户名和密码都正确,但是无法登陆


解决方法:

方法一,用FF登陆后台,在 System—Configuration-Web-Session Cookie management....timeout 改为:86400
如果方法一不行,就用方法二
方法二:仍不能登陆请打开文件app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
找到代码:

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),

$this->getCookie()->getHttponly()

);
替换为:

session_set_cookie_params(

$this->getCookie()->getLifetime(),
$this->getCookie()->getPath() ,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly() );

这些是在网上找到的,有几个版本的magento这样做过之后问题就解决了,但是还有的这样设置过后仍登陆不了后台,于是在Google里继续找原因,终于在magento论坛里看到如下内容


magento1.4.1安装完后登录不了后台,但是密码和用户名都是正确的,解决方法:
打开magento/app/code/core/Mage/Core/Model/Session/Abstract/varien.php
找到下面的代码,注释掉$cookieParams['domain'] =$cookie->getDomain();这行,就行了。
if (isset($cookieParams['domain'])) {
           $cookieParams['domain'] = $cookie->getDomain();
        }
结果如下
if (isset($cookieParams['domain'])) {
           //$cookieParams['domain'] = $cookie->getDomain();
        }
但是按照这个去做之后,还是出现错误,于是我把下面这段全部注释掉
//if (isset($cookieParams['domain'])) {
           //$cookieParams['domain'] = $cookie->getDomain();
   //      }

来自:http://www.fjshouyeseo.com



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章