![]() |
CodeIgniter 3.13 Output class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: CodeIgniter 3.13 Output class (/showthread.php?tid=92499) |
CodeIgniter 3.13 Output class - Kubura - 02-24-2025 I have an issue where CodeIgniter's Output class that serves the cached files always (even if the user isnt logged in), we are caching an output data on a certain amount of time (1h to 2h) on the end of the controller method we call $this->output->set_output($data). User can access the data by typing the URL of the controller method in the address bar and Output class returns the data. Output class first checks if there is a cached file for typed in method and then serves it if it exists (this happens before CI even boots up) and if it doesn't exist it triggers the controller and then does all the unnecessary checks (check for authentication, authorization etc), I have tried overriding the _display_cache method but you can't access controller nor session there since, as I already said, CI hasn't booted yet. Anyone knows how can I solve this problem, to forbid users from displaying the data when typing full url of the controller method. Thanks in advance, All the best! RE: CodeIgniter 3.13 Output class - InsiteFX - 02-24-2025 Start the method with an underscore _ ( _methodName() ). Make the method private. SEE: CodeIgniter 3 User Guide - Controllers - Private methods RE: CodeIgniter 3.13 Output class - Kubura - 02-28-2025 Thank you for your answer. I have decided to switch to redis for caching anyways |