1

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.

1

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:

<?php
    require_once('app/Mage.php');
    umask(0);
    Mage::app();

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

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

    //Assign Role Id
    try {
        $user->setRoleIds(array(1))->setRoleUserId($user->getUserId())->saveRelations();
    }catch(Exception $e){
        echo $e->getMessage();
        exit;
    }
    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.