Jump to content

Redirect to Admin Dashboard is not working after migrating to localhost

Recommended Posts

Posted (edited)

Hello, everyone!
I recently picked up all my files from remote server, got my SQL dump files and tried to set up a local environment to develop new features and to simplify the development process for the team. 

We are also planning to create a QA server, but while this issue persists locally I doubt that we can create a QA server.
On my local machine I am using Open Sever (also tried WAMP). The problem I get is when trying to log in to the BO. Entering the right credentials changes the URL to redirect=AdminDashboard, but I am not being redirected to the dashboard, which means I am stuck on the login page.

Here are the steps I have already done to migrate from remote server locally
1. Downloaded all the files via FTP;
2. Imported the database with all my data besides products (and all tables that are relates, like product_attribute, etc.);
3. Changed in the PS_CONFIGURATION table the following values: PS_SHOP_DOMAIN to localhost, PS_SHOP_DOMAIN_SSL to localhost, PS_COOKIE_CHECKIP to 0, PS_COOKIE_LIFETIME_BO to 0;
4. Changed parameters.php file;
5. Changed the records in the PS_SHOP_URL table to localhost;
6. Deleted all the cache from var/cache;
7. Tried removing the .htaccess file from the root;

Additional Info:

  • Prestashop Version:
  • Apache Version: 2.4
  • PHP Version: 7.3
  • MariaDB Version: 10.4

The issue persists between all browsers, so I doubt this is something cookie related.
Thanks in advance!

Edited by Qwoon (see edit history)

Share this post

Link to post
Share on other sites

This is the "admin login loop"

There are dozens of forum post about it and dozens of solutions that sometimes work. Most are cookie related. Things that sometimes work are

use https instead of http
remove .htaccess
Use localhost instead of for server (or vice versa). If the hosting provider offers yet another address like mysite.provider.com, try that
disable the option "Check the IP address on the cookie" in preferences
disable multiviews
try domain name with and without www
$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));
$cookie = new Cookie('psAdmin', substr($_SERVER['REQUEST_URI'], strlen(__PS_BASE_URI__), -10));

You write that you set PS_COOKIE_LIFETIME_BO to 0. I am not sure how that works out. It might be better to keep it at the default of 480 (hours).

You can use Prestools to make easy changes. Under Tools&Stats->Shop Rescue there are options to easily change some relevant configuration values.

The only way I would know to test whether this is module related is to rename or remove the modules trees under the /modules directory.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More