Home > Backend Development > PHP Tutorial > Solution to the problem of unable to log in to the PHP magento background_php example

Solution to the problem of unable to log in to the PHP magento background_php example

WBOY
Release: 2023-03-03 07:04:01
Original
1395 people have browsed it

Solution to PHP magento backend failure to log in

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 backend. When logging in with the account and password, it is found that there is a blank space and cannot jump to the backend. This article is dedicated to We will introduce 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 browsers handle cookies in a very similar way, they are not 100% the same. Other versions of Magento also have this problem.

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

Around line 70 you can see something like this:

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

Copy after login

Solution 2:

No need to log in with localhost,

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

You can also point to other addresses in apache,

This problem generally does not occur on the server and does not need to be modified.

magento1.9 backend cannot log in problem

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

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

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

The results are 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 entire paragraph below

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

Copy after login

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

Related labels:
php
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