後臺的用戶名和密碼都正確,但是無法登陸
解決方法:
方法一,用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();
// }