Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3.13 Output class
#1

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!
Reply
#2

Start the method with an underscore _ ( _methodName() ).
Make the method private.

SEE:
CodeIgniter 3 User Guide - Controllers - Private methods
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Thank you for your answer. I have decided to switch to redis for caching anyways
Reply




Theme © iAndrew 2016 - Forum software by © MyBB