Magento 后用不能登陆后台,没有提示用户名和密码错误的情况。
发生问题是因为无法存储cookies。我们运行localhost和本地主机是不正确的域名,但我们需要一个域去存储cookie。所以不能登陆
解决方法: 打开 app/code/core/Mage/Core/Model/Session/Abstract/varien.php
将
改为:
- // session cookie params
- $cookieParams = array(
- 'lifetime' => $cookie->getLifetime(),
- 'path' => $cookie->getPath(),
- 'domain' => $cookie->getConfigDomain(),
- 'secure' => $cookie->isSecure(),
- 'httponly' => $cookie->getHttponly()
- );
- // session cookie params
- $cookieParams = array(
- 'lifetime' => $cookie->getLifetime(),
- 'path' => $cookie->getPath(), //这里的,要去掉
- //'domain' => $cookie->getConfigDomain(),
- //'secure' => $cookie->isSecure(),
- //'httponly' => $cookie->getHttponly()
- );