解决magento后台无法登陆/登陆没有反应的方法

安装过magento的几个版本,安装好后在登陆后台的时候都遇到了点问题,用户名和密码都输入正确,就是登陆不了后台,经过研究发现,登陆不了后台的主要是因为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(); 
   //      }
posted @ 2015-07-13 08:27  JasonAndStanley  阅读(1923)  评论(0编辑  收藏  举报