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. 
 
rammohanonline
Jr. Member
 
Total Posts:  1
Joined:  2012-07-05
 

hi all,

I have got admin login screen. and I had changed the password in “admin_user” table. But I am unable to login witht same user id or password. Pls help me

 
Magento Community Magento Community
Magento Community
Magento Community
 
xildatin
Jr. Member
 
Total Posts:  2
Joined:  2010-03-30
 

I was having the same problem with 1.7.0.2 and found that editing app/code/core/Mage/Core/Model/Session/Abstract/Varien.php as suggested in this thread does allow you to log in, but it does not resolve the underlying issue, which has to do with session cookie lifetimes.  Another way to resolve the issue, without changing any code, is to go into database and update the core_config_data table to change the session cookie lifetimes.  You can do this by first checking to see if a value exists for this attribute, and if it does, update the attribute, if it does not exist, just add it.  The following is what I did for Magneto 1.7.0.2 using CentOS 6.3 and MySQL, setting the value to 84600:

SELECT FROM core_config_data WHERE path='web/cookie/cookie_lifetime';

If no value is returned then add the attribute to the table:

INSERT INTO core_config_data VALUES ('','default','0','web/cookie/cookie_lifetime','84600');

If a value was returned then update the existing value:

UPDATE core_config_data SET value='84600' WHERE path='web/cookie/cookie_lifetime';

When you are done make sure to clear the cache and session folders, or you will continue to loop.  It probably wouldn’t hurt to clear your browser’s cookies as well.

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
dlachasse
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-10-04
 

xildatin,

Thanks for the tip. I’m also running 1.7.0.2 and tried updating the db values for cookie_lifetime and it didn’t help. That issue may be specific to CentOS as I’m running my local install on Windows. The only thing that works for me is updating the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file. Instead of commenting out starting at line 88 I started it below the $cookieParams array and right before the if block at line 94:

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

I’d prefer to not have to edit the code like this which is why I was hoping that the db entry would fix it. Maybe someone else knows of a fix that doesn’t require these edits.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ortuno
Jr. Member
 
Total Posts:  1
Joined:  2012-07-11
 
rammohanonline - 06 July 2012 07:03 PM

hi all,

I have got admin login screen. and I had changed the password in “admin_user” table. But I am unable to login witht same user id or password. Pls help me

Hi, you can not changed the password in database, because the password have been encrypt.  If you can not login by forgot password, you can use forgot password feature, then new password will be emailed to you.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
rajeshkanjani
Jr. Member
 
Total Posts:  1
Joined:  2012-07-17
 

I am newbie designer in Magento. I was facing the same problem and cannot login to admin in my Windows XP. After reading this thread, it has helped in logging to admin.

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
tomkenkel
Jr. Member
 
Total Posts:  1
Joined:  2009-01-24
 
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!

For working with Magento-1.7.0.2 locally, using MAMP, laurabinos’ solution still works—thank you! Line number has changed to 108.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ElsaMagento
Jr. Member
 
Total Posts:  1
Joined:  2012-09-22
 
xxuhal - 06 July 2012 10:21 PM

My sister has a virus on her computer and I want to reformat her harddrive and reinstall Windows XP.

ok, but that does not seem at all relevant to Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Surf Web Design
Member
 
Avatar
Total Posts:  31
Joined:  2011-07-28
Calgary, Alberta, Canada
 
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!

Yes this worked for me. Thank you so much!!!! smile
Using Magento 1.7.0 on a Godaddy Dedicated Server. Not a Localhost.
Just moved the Magento site from one domain to another and could not login to the admin afterwords.
I also had to change the table in the database core_config_data and change the old url to the new url in 4 spots

 
Magento Community Magento Community
Magento Community
Magento Community
 
topsky
Newbie
 
Total Posts:  0
Joined:  2012-12-18
 
dlachasse - 17 July 2012 09:27 AM

xildatin,

Thanks for the tip. I’m also running 1.7.0.2 and tried updating the db values for cookie_lifetime and it didn’t help. That issue may be specific to CentOS as I’m running my local install on Windows. The only thing that works for me is updating the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file. Instead of commenting out starting at line 88 I started it below the $cookieParams array and right before the if block at line 94:

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

I’d prefer to not have to edit the code like this which is why I was hoping that the db entry would fix it. Maybe someone else knows of a fix that doesn’t require these edits.

That’s work for me as well. Thanks to share the solution. Hopefully, Magento can fix it in next version.

 
Magento Community Magento Community
Magento Community
Magento Community
 
besttemplates4
Jr. Member
 
Total Posts:  1
Joined:  2013-02-07
 

thanks for advice, i hope it helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
buddybakhuijsen
Jr. Member
 
Total Posts:  1
Joined:  2013-02-22
 

I’m facing the same problem. Perfectly easy installation, but I can’t login the admin after installation. I read all posts in this section, as far as I can see my line of code looks the same as provided below. I still face the login problem. Anyone any idea on how to solve this problem?

Thanks!

Monty22 - 07 February 2013 10:27 AM

Hi,

if you are unable to login to admin panel of Magento after a fresh installation on localhost, then go the file

app\code\core\Mage\Core\Model\Session\Abstract\varien.php

and look for the lines of the code which says,

‘domain’ => $cookie->getConfigDomain(),
‘secure’ => $cookie->isSecure(),
‘httponly’ => $cookie->getHttponly()

Comment these lines of codes and login again. It will work perfectly.if you will face any issue again then, you can contact us as we are one of the magento extension developers.

Thanks

Monty
iLoveMage

Get 25% discount on all our magento extensions.
Image Attachments
code screenshot.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
sh9723074
Newbie
 
Total Posts:  0
Joined:  2013-04-09
 

The same problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliversergeant
Jr. Member
 
Total Posts:  4
Joined:  2013-05-30
 

USE firefox to log in !

Cheerz

 
Magento Community Magento Community
Magento Community
Magento Community
 
Twist6040
Jr. Member
 
Total Posts:  1
Joined:  2013-10-02
 
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 a lot for this solution. It helps me in the resolving problem of login panel. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
yuriymos
Jr. Member
 
Total Posts:  11
Joined:  2013-11-18
 
Ernazar_WP - 05 May 2009 09:07 PM

I found another solution for this.

The problem is in Session, magento can not set session and always create it again, that is why logination does not work.

so In the class Mage_Core_Model_Session_Abstract_Varien
there are following lines, which defines some session params

session_set_cookie_params(
            
$this->getCookie()->getLifetime(),
            
$this->getCookie()->getPath(),
            
$this->getCookie()->getDomain(),
            
$this->getCookie()->isSecure(),
            
$this->getCookie()->getHttponly()
        );
In this function params - the problem is. I have just commented this code and it started to work.
Someone can try to play with preferences, for example $this->getCookie()->getDomain() - woudl be localhost, may be because of this it can not be saved.

This helped me. Tried to use 127.0.0.1, but the browser woud automatically convert it to localhost

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