最近遇到個magento背景登入不了的問題,但是經過排查背景使用者名和密碼都是正确的,但是就是登入不了背景。我勒個去,糾結……也不報錯,最後終于找到解決的辦法了如下
解決方法如下:(注意大小寫哦)
打開檔案 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() );
替換為:
$this->getCookie()->getPath() ,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly() );
但是還有的這樣設定過後仍登陸不了背景
magento1.4.1安裝完後登入不了背景,但是密碼和使用者名都是正确的,解決方法:
打開 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'])) {
// }
搞定,現在所有版本magento登陸不了背景的問題都解決了
或者把
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
//call_user_func_array('session_set_cookie_params', $cookieParams);
或者把這一行注釋掉,大概在104行.更改這個之後絕對可以登入背景,我已經親自測試過。
改過後可以登入背景了,然後在去改下面這個,把值改下,在還原上面注釋的檔案,去登入試試,如果可以登入就好,如果還是不行,那隻有在去注釋掉了