Redirect problem in IE8 compatibility mode (IE7)


Using the little redirect below on a multi page form, once validation is ok session data is added and than redirected. Works fine in most modern browsers, IE8 compat(ie7) mode seems to not like very much, sometimes it works, most times not.

redirect('shop/device/'.$this->dealer->dealer.'/plan_information', 'refresh');

Any suggestions on a better solution?

[eluser]Keeshond Loekie[/eluser]
Did you already solve this? I have a similar issues where the redirect in IE8 isn't working (at all)

Just a cursory look at the problem, I believe it has to do with IE8's built in xss filtering. This can be turned off by the user; however, in site design there is no way to predict what the user has or has not selected.


According to the flow chart at the above reference, it would appear that IE8 is not evaluating the redirect as being at the same site. I may be wrong on this issue though.

[eluser]Keeshond Loekie[/eluser]
Not sure, there didn't seem a difference with or without that setting on. I just resorted to a quick fix and added a "script" version to the redirect in the url_helper.php file; not neat as I shouldn't update core files, but sufficient for my needs and don't want to spend more time on it.

case 'script': echo "<script>window .location.href='$uri';</script>"; break;

I generate some similar redirects in my CI app.

It works fine with IE8, Firefox, Safari.

IE7 repeatedly takes the redirect, and does a GET on /index.php instead. I am using
Apache and can see it in the site's access-log.

I have found at least one similar bug report on a vanilla PHP app having the same
issue where header redirects sent to IE7 ended up on the index page instead. The thread
was, alas, from March 2008. This one looks more recent, but same problem.

Any hints appreciated....

In fixing this IE7 problem on my site, I notice the following:

- It is a really good idea to use a rewrite rule at the server, and set the index_page in config/config.php to an empty string, as IE7 CURI seems to have a problem with seeing a file extension (index.php) followed by something that isn't a query string.

- Going between IE8 and IE7 compatibility mode will cause the md5 hash to fail on the session cookie, and if you enable checking on the user-agent, it will destroy the session, including your user-data

- If you use the database option with the Session class, your custom user data never gets to the cookie, it is fetched from the db, which would be a nice thing to document so you don't stare too long at the cookies in IE7 wondering where the data is....

- If you have a form processed by IE7, and it has multiple submit buttons, the value of ALL the submit buttons, even those not clicked, will appear in the $_POST array. So any if-then-else code looking for one particular button just became very order-dependent and fails for all except the first button.

Hope this helps someone else.

Quote:I just resorted to a quick fix and added a “script” version to the redirect in the url_helper.php file; not neat as I shouldn’t update core files, but sufficient for my needs and don’t want to spend more time on it.
Place your code in a MY_url_helper.php in your application/helpers folder. That way you can "extend" the helpers instead of editing the core files.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.