Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can’t login to admin after installation. 
 
Cell Nerds
Jr. Member
 
Total Posts:  19
Joined:  2010-07-21
 
laurabinos - 24 March 2010 10:56 AM

This solution is for magento-1.4.0.1:

- Go to magentodir/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

- and comment just line 100 like this

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



It will work after that!

Thanks all Worked great for me

 
Magento Community Magento Community
Magento Community
Magento Community
 
abbyink
Jr. Member
 
Total Posts:  1
Joined:  2010-11-03
 
laurabinos - 24 March 2010 10:56 AM

This solution is for magento-1.4.0.1:

- Go to magentodir/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

- and comment just line 100 like this

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



It will work after that!

laurabinos! I bow down to you and your godly tactics. Seriously though, I had been trying everything to login to the admin panel and nothing worked except for your method. By the way, I have Magento 1.4.1.1 on Mac OSX with MAMP, so for all those with version 1.4.0.1 and above this will work!

 
Magento Community Magento Community
Magento Community
Magento Community
 
avgorp
Jr. Member
 
Total Posts:  2
Joined:  2010-10-07
 

I got a similair problem: couldn’t login in the admin. However, after clicking on “forget your password” and immediately on “back to login”, so without request a new password I could log in.

Solved this by adding a new page which redirect the user automatically to a admin login page where it is possible to log in.
The code of this CMS page:

{{block type="catalog/navigation" template="catalog/navigation/alternativelogin.phtml"}}

And alternativelogin.phtml:

<?php
Mage::app()->getFrontController()
->getResponse()
->setRedirect('http://www.yourdomain.com/index.php/admin/');
?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
dkinkead
Jr. Member
 
Total Posts:  1
Joined:  2010-11-29
 

I have been assigned the task of evaluating eCommerce solutions for my company. We are medium sized solution provider and need a dependable eCommerce product that we can offer our clients. Magento looks promising, but I have had nothing but problems during the installing process. Installing the sample data was a huge problem. I had to make numerous edits to the sql script in order to get it to work--why in the world would Magento provide such a riddled file?  Finally getting the installation complete and accessing the admin, I find the only page I can get to is the dashboard--ALL OTHER PAGES GIVE ERROR. Yes error, with no way of viewing the error. There is a message that there are problems with the several indexes and to click a link to repair and of course that link goes directly to a error page.
OK, maybe I just need to logout, and log back in. WRONG. now I can’t log back in (100% correct username/password).  ARE YOU SERIOUS? logging in should not be that difficult. If Magento can’t get that right, I have serious questions about the its overall dependability. Should I pursue this solution? Will it be worth my time?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jur erick
Member
 
Total Posts:  38
Joined:  2011-01-11
 
Vivekananthan - 19 February 2010 01:45 AM

If its magento 1.4 then go to the following file:
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

On Line no: 78

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

        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();
        
}

Change it to:

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

        
/*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();
        }*/

That’s it, it would work smile
Let me know if you have any problems on that.

IT REALLY WORKS!! THANKS smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
reynanpm
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2011-03-09
 
Vivekananthan - 19 February 2010 01:45 AM

If its magento 1.4 then go to the following file:
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

On Line no: 78

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

        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();
        
}

Change it to:

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

        
/*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();
        }*/

That’s it, it would work smile
Let me know if you have any problems on that.

This doesn’t seem to work on my installation. I’m using Magento 1.4.3 EE, is there any other alternative?
By commenting some of the codes, it gives me Parse error and not able to see the admin login page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mark75
Jr. Member
 
Total Posts:  1
Joined:  2011-03-27
 
laurabinos - 24 March 2010 10:56 AM

This solution is for magento-1.4.0.1:

- Go to magentodir/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

- and comment just line 100 like this

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



It will work after that!

Works for me. Thx guys!

 
Magento Community Magento Community
Magento Community
Magento Community
 
janekkosior
Jr. Member
 
Total Posts:  8
Joined:  2011-04-08
 

Changing the code works like a charm for 1.4 - but does it work for 1.5 ? I want to upgrade

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
buiak
Jr. Member
 
Total Posts:  1
Joined:  2009-01-27
 

Is not working for magento 1.5 .... the issue problem is still there :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 

None of the solution work for Magento 1.5 and 1.6alpha

 
Magento Community Magento Community
Magento Community
Magento Community
 
freelancerpush
Jr. Member
 
Total Posts:  16
Joined:  2009-03-15
Indore, India
 

Simple solution is here.... http://www.pushpendra.net/can-not-login-into-admin-in-localhost-magento-problem/

Hope it will work

 
Magento Community Magento Community
Magento Community
Magento Community
 
phpkrishna
Jr. Member
 
Total Posts:  2
Joined:  2011-12-06
 

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

go to this FILE

and comment the following links

//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
it will work now in chrome ok

if :
http://localhost/magento/admin

this is the correct way

 
Magento Community Magento Community
Magento Community
Magento Community
 
canadadan
Jr. Member
 
Total Posts:  3
Joined:  2009-01-22
USA
 
laurabinos - 24 March 2010 10:56 AM

This solution is for magento-1.4.0.1:

- Go to magentodir/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

- and comment just line 100 like this

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



It will work after that!

It did for me.  I did an upgrade from 1.3.23 to 1.6.2.0 on Mac with MAMP.  That was the only issue and was resolved. Quickly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amdadhbd
Jr. Member
 
Total Posts:  1
Joined:  2012-03-12
 

very basic problem I also face when I install Magento in my local machine WAMP. To solve this issue you need to change the base URL:

If you install it in localhost then use http://127.0.0.1 in place of http://localhost.

For Admin the login URL will be like http://127.0.0.1/magento/admin

Hope it will work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
softmixt
Jr. Member
 
Total Posts:  2
Joined:  2012-06-10
 

you need to use link format as this http://127.0.0.1/magento

Go to your database MYSQL and type:

1 -

SELECT FROM core_config_data WHERE value LIKE " % localhost % " ;
2 -
UPDATE core_config_data SET value="http://127.0.0.1/" WHERE path IN ('web/unsecure/base_url' 'web/secure/base_url' );

Then go to magento/var/cache and clean it.

Refresh the page as 127.0.0.1/magento.

Done.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top