I just ran across a problem that took a little while to figure out and wanted to document it for someone else that may have the same issue.
Our site can be used in different countries, so we have URLs that look like this:
http://www.example.com/
http://www.example.com/CA
http://www.example.com/UK
The first automatically goes to the US. We use a cookie to remember their country so that when they come back to the site later (http://www.example.com), we redirect them to (http://www.example.com/CA)
When someone wants to go back to the US version, they click a link like this (http://www.example.com/US) which sets their cookie and redirects back to the main site because the US one normally doesn’t have the country code.
In doing these redirects, we would do the following if they clicked the /US link:
SetCookie("US");
Response.RedirectPermanent("/");
The problem came when they switched to Canada (which worked) and then tried to switch back to the US. Answer below.
The problem came with Google Chrome. Because we used a permanent redirect, it would not even send http://www.example.com/US to the browser. It said basically:
So the fix was to use Response.Redirect (302) instead of Response.RedirectPermanent (301).