On localhost can't login to admin panel.

It does not work with newly created admin users also.

After log in attempt i see that magento creates session files in var/session. No error in system.log.

Problem appeared after i moved installation to another computer.


Method 1:

You can directly check the user in database if anything wrong. Or you can also change the password for that user as well from database directly as Magento 1 uses MD5 encryption for admin password.

Method 2:

You can create a custom script and place that to your magento root and run through browser. That will create new admin user then you can login to your admin through that user and then reset the password for previous user accordingly.

Script for create admin user programmatically:


    try {
        $user = Mage::getModel('admin/user')
                                'username'  => 'your_username',
                                'firstname' => 'YOUR FIRST NAME',
                                'lastname'    => 'YOUR LAST NAME',
                                'email'     => 'youremail@example.com',
                                'password'  =>'your_password',
                                'is_active' => 1

    }catch(Exception $e){
        echo $e->getMessage();

    //Assign Role Id
    try {
    }catch(Exception $e){
        echo $e->getMessage();
    echo "User created successfully";
  • I already tried to create a new user. And also i tried to update passwords for existing ones with no luck. – Asadov Kamran Aug 25 '18 at 9:56
  • I will try to debug it with xdebug to see what causes the exception. – Asadov Kamran Aug 25 '18 at 14:50
  • i'm facing same issue no luck upto yet – Aadii Mughal Apr 16 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.