In my Codeigniter app, I have an authentication method to check, if the user is logged in. It is based on session cookies (the standard CI way) and it works perfectly fine.
This method is called from the constructor of each and every controller.
If the user is not logged in, the authentication method redirects to login page.
In the app, there's an option to upload files as well and the uploading part works fine too. The files get stored into one particular directory in the server. However, if someone has the uri/url of the uploaded file(s), he or she is able to access that, even without logging in the application. Since it is just a url and doesn't come from any controller, anybody will be able to access that even if the person is not logged in.
Any thoughts on how to prevent this.
Thanks