Jump to content

Analyzing the Login Loop bug


musicmaster

Recommended Posts

The Admin Login Loop bug is a bug that has been around for many years. Many PS webshop owners have seen it at least once. In an effort to solve it I have grabbed the last occasion that it occurred to me to make some analysis. I hope that others will grab the opportunity to build on this effort so that finally we can leave this problem behind us.

 

I first tried emptying the cache and deleting the cookies: no result.

 

Then I tried with the Shop Rescue page of Prestools to switch some configuration flags to see whether any had an effect. It appeared that switching PS_HTACCESS_DISABLE_MULTIVIEWS on solved the bug. 

 

However, as other webshops on this server were running ok it appeared unlikely that this Apache feature was the culprit. So I tried deleting .htaccess. That worked too. So I compared this .htaccess with that from another - working whop. However, I couldn't find any difference: everything seemed ok.

 

Of course a Prestashop cannot with a .htaccess file. So I went in the backoffice to regenerate it. Initially that resulted in two errors (my shop language is Dutch so the text may not be exactly correct)

 - the route is not valid

 - route to modules: incorrect value.: 

 

When I pressed save to generate a .htaccess file a second time there was no error.

 

That left the question where those "route" errors came from. So I compared a dump of the configuration table taken before with a dump taken after the .htaccess generation. It appeared that the following values had been added:

 

 

402, NULL, NULL, 'PS_ROUTE_product_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),

(403, NULL, NULL, 'PS_ROUTE_category_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),
(404, NULL, NULL, 'PS_ROUTE_layered_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),
(405, NULL, NULL, 'PS_ROUTE_supplier_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),
(406, NULL, NULL, 'PS_ROUTE_manufacturer_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),
(407, NULL, NULL, 'PS_ROUTE_cms_rule', NULL, '2016-12-11 10:04:39', '2016-12-11 10:04:39'),
(408, NULL, NULL, 'PS_ROUTE_cms_category_rule', NULL, '2016-12-11 10:04:40', '2016-12-11 10:04:40'),
(409, NULL, NULL, 'PS_ROUTE_module', 'module/{module}{/:controller}', '2016-12-11 10:04:40', '2016-12-11 10:04:40');

 

I checked another - working - shop. There these values were already there. Maybe the problem was that this was a new shop. I don't know. Anyway, the bug has disappeared.

 

BTW. it is rather easy to see which values in the configuration table of your shop were changed most recently: just open the ps_configuration table in phpmyadmin and sort it on the date_upd field with most recent first.

 

If you have a problem with a login loop, please mention it here and tell everyone whether this helps you to find a solution. If not, we may find  way tio help you.

Edited by musicmaster (see edit history)
Link to comment
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...