![]() |
MaintenanceFilter vs JavaScript - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: MaintenanceFilter vs JavaScript (/showthread.php?tid=90782) |
MaintenanceFilter vs JavaScript - Gary - 05-03-2024 With all the changes to CI's routing, I'm wondering if there is a clever trick to be able to bypass the Maintenance filter on a (in my case necessary) second entry? In order to refresh the page (with a "Down for Maintenance" page), it is necessary to initiate a page refresh... which is easy enough to initiate in the (now enabled) MainenanceFilter. The problem is that this means there is now a second request (redirection) coming in from the client... which then gets repeatedly caught by the MaintenanceFilter. I have patched it with a few new $_SESSION variables... to indicate that it's a reentry call... and also some changed to the users' $_SESSION (so as to disable the users' control/input, in such a manner that the session can be be restored/re-enabled, if the maintenance outage is only going to be brief). So the question is... although I have it working, there are messy (and seldom required) $_SESSION checks and processing now dotted around elsewhere in the code, which irritates me... is there a more elegant way of handling this need for the reentry/second run though the Filter/s? |