CodeIgniter Forums
set_header not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: set_header not working (/showthread.php?tid=67602)



set_header not working - edo - 03-14-2017

Hi All,

CodeIgniter 3.

In all of my pages (responses), the expires header is set to Thu, 19 Nov 1981 08:52:00 GMT, so I added this to my controller:

Code:
$this->output->set_header("Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT");

But I keep getting the same value. Nothing changes.

What am I doing wrong?

Thank you.


RE: set_header not working - iz_no_good - 03-14-2017

perhaps this gets undone later in your code.

if i was you i would try to identify where the weird expiration date is set to year 1981 as you mention.


RE: set_header not working - edo - 03-14-2017

(03-14-2017, 11:09 AM)iz_no_good Wrote: perhaps this gets undone later in your code.

if i was you i would try to identify where the weird expiration date is set to year 1981 as you mention.

Thank you for your answer, but I did a file search and there is no other place where this is set.


RE: set_header not working - skunkbad - 03-14-2017

Is this hosted on Godaddy? I once had an issue where they were stripping headers from my code, and even after proving to them that their server was doing it, they wouldn't do anything about it.

I always set headers with the PHP header function.