Welcome Guest, Not a member yet? Register   Sign In
IE8 with High security settings - redirect() doesn't work but header() does
#1

[eluser]houdini2232[/eluser]
We had reports that our site was having issues and I discovered that in IE8, when we crank the security settings to "High", this code was throwing a blank page:

redirect('/', 'refresh');

We changed it to this:

header('Location: /'); exit;

And that worked.

Using CodeIgniter 1.7.2. I'll try this out the next time I have the chance to work with CI 2.0. Perhaps this has been fixed.
#2

[eluser]Narkboy[/eluser]
[quote author="houdini2232" date="1308181646"]
Using CodeIgniter 1.7.2. I'll try this out the next time I have the chance to work with CI 2.0. Perhaps this has been fixed.[/quote]

Not sure this is a CI bug. The redirect function works by sending a header with either 'refresh' or 'location'. The 'refresh' method is seen as a poor alternative, primarily because it was originally (and still can be) used to periodically reload a given page. The W3C reccomends it is not used as a redirect for various reasons. The preferred method is to use 'location' unless you run a Windows web server on which 'location' does not function properly.

As a side note, be careful when using status codes with 'location' other than the default 302. I had a headache with broswers remembering (typically 401 and 403) them and then forever refusing to request the correct page. This is basically to do with using PHP-only authetication rather than HTTP auth.

/B
#3

[eluser]John_Betong_002[/eluser]
Try this:
Code:
redirect(base_url(), ‘refresh’);
  // or this
  redirect(base_url(), ‘location’);
 




Theme © iAndrew 2016 - Forum software by © MyBB