Welcome Guest, Not a member yet? Register   Sign In
redirect() not affected by $this->output->set_header()
#1

[eluser]aaronadams[/eluser]
If I set a header with $this->output->set_header(), and then I do an HTTP redirect with the redirect() helper, my header doesn't make it into the redirect.

Scenario:

Facebook iframe apps require a P3P header in order for Internet Explorer to allow cookies to be set by the iframed page.

Facebook will send user data to the iframe via POST; best practice is to process the POST data, create a session, and 302 redirect to a GET request of the same resource.

If I set the P3P header with $this->output->set_header(), start a session, and then redirect(), Internet Explorer ignores the session data, breaking the app.

I'm now forced to set my header with PHP's builtin header() as opposed to using CI's Output class. In conjunction with gzip, setting a header this way, without the assistance of the Output class, makes me extremely nervous.

It seems to be that the solution would be to re-implement redirect() as a method of the Output class, with the helper calling the method. This way, the class could output its headers before setting the Location header and exiting.


Messages In This Thread
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 01:49 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 02:22 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 02:26 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 04:38 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 05:33 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 05:38 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-19-2012, 08:19 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-20-2012, 02:13 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-20-2012, 04:18 PM
redirect() not affected by $this->output->set_header() - by El Forum - 04-24-2012, 08:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB