Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Open to all! Ask other shopowners for help.
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

I'm getting close, or at least closer, to migrating my 1.0.5.0 Phoenix Shop to 1.0.8.20 using PHP 8.1 and just discovered a problem on my 1.0.8.20 shop when I have items in my shopping cart and haven't yet logged in. If I click on the Checkout Button in the Shopping Cart page it takes me to the login page via a redirect from checkout shipping...for some reason that results in the TOO-MANY-REDIRECTS issue as can be seen in the Chrome network tool. A screeen shot is attached. Thanks to Matt for pointing out the use of that Chrome tool in trouble shooting a different TOO-MANY-REDIRECTS issue otherwise I think I would have spent way to much time thinking this was a cookie issue as suggested by Firefox.

In trying to trouble shoot this I tested logging in when I have an item in my shopping cart using the login option from the NavBar My profile dropdown list and that seems to take me directly to the login page and things work as expected. I have Rainers Shipping estimator installed on the Shopping Cart page where I also have the Checkout Button and if I login using his Shipping Estimator Login button things also work as expect as well. Both take me directly to the login page without the redirect from checkout shipping. While the TOO-MANY-REDIRECTS issue might be caused by some other problem I'm thinking that the redirect to the login page via the checkout shipping page using the Checkout button is causing the problem but that is just pure speculation on my part.

I'm at a bit of a lost as to where I should go from here....if anyone has any suggestions I'd welcome them.

Dan
chrome network.jpg
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by burt »

I remember having a similar problem and it turned out that the configure.php file was incorrect, but I can't remember exactly the fix.
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

In case it helps here is what my shop side config file looks like...

error_reporting(E_ALL);

const HTTP_SERVER = 'https://fishfoods.ca';
const COOKIE_OPTIONS = [
'lifetime' => 0,
'domain' => 'fishfoods.ca',
'path' => '/PhoenixCart/',
'samesite' => 'Lax',
'secure' => true,
];
const DIR_WS_CATALOG = '/PhoenixCart/';

date_default_timezone_set('America/New_York');

Dan
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by raiwa »

Just to be sure: you are not using my 2 page checkout addon?
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

raiwa wrote: Thu Jul 18, 2024 4:22 pm Just to be sure: you are not using my 2 page checkout addon?
Not on my 1.0.8.20 shop but I do use it on my 1.0.5.0 site.

Dan
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by burt »

When I visited fishfoodS.ca it redirected me to fishfood.ca (note no S), then back to fishfoodS.ca

That might be part of the problem ?
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

burt wrote: Thu Jul 18, 2024 4:44 pm When I visited fishfoodS.ca it redirected me to fishfood.ca (note no S), then back to fishfoodS.ca

That might be part of the problem ?
You have keen eyes Gary...I needed my cheats to see that. I tried fixing it via the cpanel but it won't allow me to do that so I sent a note to the host and asked for that to be sorted...as soon as it is, I'll test again and see if it helps. In either case I'll report back. Thanks for checking it and for the idea.

Dan
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

When I visited fishfoodS.ca it redirected me to fishfood.ca (note no S), then back to fishfoodS.ca

That might be part of the problem ?
The "s" issue has been sorted but unfortunately the TOO_MANY_REDIRECTS issue persists.

Dan
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by Dan Cole »

Found it....it is caused by this hook that we added to bypass the shipping page when shipping was already selected using the shipping estimator.

Code: Select all

class hook_shop_checkout_shipping_skipShipping {

  public function listen_injectRedirects() {
   //[list] $_SESSION['shipping'] = false;[/list]
   // $_SESSION['sendto'] = false;
    Href::redirect($GLOBALS['Linker']->build('checkout_payment.php'));
  }

}
I assume it needs some kind of condition so it doesn't try to skip the shipping page if it is not set. Perhaps $_SESSION['shipping'] is set to true when set and can be used for that purpose.

Dan
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Trouble Shooting - ERR_TOO_MANY_REDIRECTS

Post by raiwa »

You should use the 2 page checkout which handles it.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply