Cannot access back office after you even changed your password?

Mad userChanged your password in several ways but could not access your back office? I think this happened not only to me so I’ll share my experience how I solved this problem.


1. Check if you are changing your password in correct server and correct database

Many times people just mix databases or servers. If you are sure then check this post maybe it will help you. If this method didn’t solved your problem go to step 2.

2. Check your __PS_BASE_URI__ parameter in file

Your PrestaShop is  installed in web server root directory or sub directory. If you moved your shop to other directory then __PS_BASE_URI__ is incorrect and you will not be able to log in to your back office anymore. Or you could change this parameter accidentally.

Find file /config/ Open it with text editor and check __PS_BASE_URI__ parameter. If your PrestaShop is located in a sub directory then it should look like this:

define('__PS_BASE_URI__', '/your_sub_directory_name/');

If it is in web server root directory then it should look like this:

define('__PS_BASE_URI__', '/');

It helped to me but if you still cannot access your admin admin then go to next stepl

3. Hack your PrestaShop (you’ll need FTP access)

It’s not actually a hacking because you’ll need access to your PrestaShop php files :) but it will allow you to access PreStashop back office with correct email and any at least 5 symbols random password – PrestaShop checks password length before authentication.

This method is unsecure because anybody will be able to login with correct email and any long enough password. 

OK find the file: your_admin_folder/login.php.

Find line:

$employee = $employee->getByemail($email, $passwd);

Change it to:

$employee = $employee->getByemail($email, null);

Now try to login  with correct email and at least 5 symbols random password. It worked for me – tested with PrestaShop and

As I mentioned before this method is not actually hacking but it may be used for malicious purposes also :)

Updated 2011.07.02:

Well there is one more reason that can cause this problem – PHP bug:

This problem was also reported to PrestaShop:

If your PHP installation has this bug then $_SERVER[‘PHP_SELF’] variable will return the wrong value which is used in cookie path calculation.You can find this line in your admin folder/login.php file (54 line i PrestaShop

$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'],
strlen(__PS_BASE_URI__), -10));

Change this line to:

$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'],
strlen(__PS_BASE_URI__), -10));

It resolved the problem for me.

Hope you liked this post. Feel free to comment or suggest ideas for new articles  :)

17 thoughts on “Cannot access back office after you even changed your password?

  1. We can help you if you provide FTP access or source code. What version of PrestaShop are you trying to access?

  2. Hi,
    same problem for me, i tried your updated solution but not working.Following is my system information
    Prestashop : 1.4.3

    1. Can you provide FTP access? It’s hard to tell what’s wrong with the PrestaShop without seeing the source code.

          1. vodien.comHi Donatas,
            Thank you for your support.
            I solved my problem ,it was problem with IP checking.I got solution from here Click Here.

  3. Hi I tried this but it still doesnt work :( I have the same problem. But everytime I login, it redirects me to the login page. I have the current version of prestashop. hope you can help me. thanks!

    1. Problem is fixed.
      Somebody edited init.php file located in admin catalog. It was:

      $cookie = new Cookie(‘psAdmin’, “Staaladmin”);

      And it should be:

      $cookie = new Cookie(‘psAdmin’, substr($_SERVER[‘SCRIPT_NAME’], strlen(__PS_BASE_URI__), -strlen($currentFileName[‘0′])), $cookieLifetime);

      I have sent you the whole information to your email.
      Well case is closed :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>