• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Header not set in CI4

Hye guys.
Just need a help!!!
When I was using ci3 so I faced an issue when user clicked browser back button, that's show " resubmit the form", so I solved that issue after setting header in ci3. Now I upgrade my site ci3 to ci4 and again I m facing same issue. Can anyone plz convert this code in CI4?

CI 3 code in Controller construct

$this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:iConfused') . 'GMT');
$this->output->set_header('Cache-Control: no-cache, must-revalidate');
$this->output->set_header('Cache-Control: post-check=0, pre-check=0', false);
$this->output->set_header('Pragma: no-cache');

CI 4 code in BaseController

$response->setHeader('Last-Modified',gmdate("D, d M Y H:iConfused").'GMT');
$response->setHeader('Cache-Control', 'no-store');
$response->setHeader('Cache-Control', 'no-cache');
$response->setHeader('Cache-Control', 'must-revalidate');
$response->setHeader('Cache-Control', 'post-check=0');
$response->setHeader('Cache-Control', 'pre-check=0');
$response->setHeader('Cache-Control', 'no-cache');

In CI 4 it is not working.
Any help will be appreciated.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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