Home » Magento

Magento Admin login problem

7 July 2009 29,701 views Popularity: 12% Share/Bookmark

email

Problem:

I had a new installation of magento. But I was unable to login as an administrator. I went

to the admin login page, entered correct username and password but was redirected to the

same login page. I could not enter the dashboard page. Error message is displayed when I

enter wrong username or password. But nothing is displayed and I am redirected to the same

login page when I insert correct username and password.

Solution:

I googled and found these solutions:-

1) Use 127.0.0.1 instead of localhost in your url, i.e. using

http://127.0.0.1/magento/index.php/admin instead of
http://localhost/magento/index.php/admin . But this didn’t solve my problem.

2) Since I am using Windows XP, I was suggested to open “host” file from
C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost

or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.

3) This solution finally helped me out of this problem. The solution was to modify the core

Magento code. Open

app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the

lines 80 to 83. The line number may vary according to the Magento version. But these lines

are present somewhere near line 80. You have to comment the comma (,) in line: $this-

>getCookie()->getPath()//,

// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

Well, I am out of this problem. Hope, this solution you also help you.

Update (For Magento 1.4.*)

In Magento 1.4, you have to comment code from line 86 to 98 in

app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Like this:-

/*  if (!$cookieParams['httponly']) {
	unset($cookieParams['httponly']);
	if (!$cookieParams['secure']) {
		unset($cookieParams['secure']);
		if (!$cookieParams['domain']) {
			unset($cookieParams['domain']);
		}
	}
} 

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

Related posts:

  1. WordPress MU: Admin login problem
  2. Magento: Solution to “Error: 404 Not Found” in Admin Login Page
  3. Magento: Disable Admin Notification Popup
  4. Magento: How to disable / remove Secret Key from Admin URL?
  5. Magento: How to get admin user id, name, username, email, etc?
  6. Magento: How to change Admin URL Path?
  7. Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website
  8. PHP 5.3 & Magento Older Versions: How to use them together?
  9. Magento Error – Notice: Undefined index: 0 app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92
  10. Magento: Admin Controller Override
  • http://www.webcenter.co.in/repository/magento-admin-customer-login-problem Magento Admin / Customer login problem | Repository

    [...] I found this useful code at http://blog.chapagain.com.np/magento-admin-login-problem/ [...]

  • Manish Chauhan

     * I will want a way to flag an order as Sales Receipt or Invoice in Magento anyways so we can use that as a guide when we run a sync in T-Hub.Can this be made to show a color flag specific to Sales Receipt and a different color for Invoices in the Orders listing page in Magento?
        * Is there anything that can be shown visually to indicate in Magento that the order has already been synced to QB? Could this also be shown on the Magento Order listing page?

    can i get it in magento??

  • Numan_tahir1

    yaa nice work its working…. :)

  • http://twitter.com/aftabnaveed Aftab Naveed

    You Rock man!

  • Komal Web

    I have installed a copy magento in ubuntu which was working fine on windows.
    Not m facing a problem that which typing the admin url it is not displaying any login window. Frontend is working find. also I have checked rewrite module and curl. 
    Do you have any idea why the application is not working on ubuntu platform only for admin area.
    Also it is not displaying any error in log.

  • petrus

    cool

  • Jit

    Update (For Magento 1.5.*)
    // session cookie params
            $cookieParams = array(
                ‘lifetime’ => $cookie->getLifetime(),
                ‘path’     => $cookie->getPath()//,
                //’domain’   => $cookie->getConfigDomain(),
                //’secure’   => $cookie->isSecure(),
                //’httponly’ => $cookie->getHttponly()
            );

  • Hervé

    Also works with 1.6.
    Do not forget to comment line 104 :

    //call_user_func_array(‘session_set_cookie_params’, $cookieParams);