magento后台登陆不进去,也不提示错误

在magento搬家的时候,经常会遇到输入正确的用户名和密码,后台登陆不进去的情况。

这个问题常见于1.7版本,主要是session的问题。解决办法如下:

1,

Go to 项目/app/code/core/Mage/Core/Model/Session/Abstract

Open the file Varien.php

Go to line no. 108

注释掉

1
call_user_func_array(‘session_set_cookie_params’, $cookieParams);

[caption id=”attachment_1252” align=”alignnone” width=”300”]ow-to-solve-magento-admin-login-not-working ow-to-solve-magento-admin-login-not-working[/caption]

 

2,也是这个文件,但是是改另外一处地方

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
改成
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);

也就是注释掉
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()

再登陆,就发现登陆进去了

坚持原创技术分享,您的支持将鼓励我继续创作!