Solution to the problem of unable to log in to the PHP magento background

高洛峰
Release: 2023-03-04 13:52:01
Original
1286 people have browsed it

PHP magento background cannot log in solution

Many friends may have the same experience. Magento can be accessed normally after configuring the domain name in the server, but after configuring it locally, it cannot log in to the background. Log in with account and password. I found that there is a blank space and I cannot jump to the backend. This article introduces two methods to solve the problem of being unable to log in to the local magento backend. Friends in need can refer to it.

Solution 1:

This is a cookie problem. This problem can be solved by using non-IE core browsers such as firefox. Although the way browsers handle cookies is very similar, it is not 100% the same, other versions of Magento also have this problem.

The detailed method to correct this problem is to locate: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php.

You can see something similar around line 70:

// set session cookie params
/* 码农教程 http://www.manongjc.com */
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath() // 注释掉后面或删除
Copy after login

Solution 2:

Do not log in with localhost,

Change to your IP address to log in: for example http://192.168.1.100/ and add the backend address,

can also point to other addresses in apache,

will generally not appear on the server There is no need to modify this issue.

Magento1.9 background cannot log in problem

Open magento/app/code/core/Mage/Core/Model/Session/Abstract/varien.php

Find the following In the code, comment out the line $cookieParams['domain'] = $cookie->getDomain(); and that's it.

if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}
Copy after login

The result is as follows

if (isset($cookieParams['domain'])) {
//$cookieParams['domain'] = $cookie->getDomain();
}
Copy after login

But after following this, an error still occurred, so I commented out the following paragraph

//if (isset($cookieParams['domain'])) {
//$cookieParams['domain'] = $cookie->getDomain();
// }
Copy after login

Thank you for reading, I hope it can help everyone, thank you everyone for your support of this site!

For more articles related to solutions to the problem of unable to log in to the PHP magento backend, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!