CodeIgniter Forums

Full Version: Random Access Denied
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello, I looked a little bit the forum. I'm new here, so please excuse me if I'm doing something wrong.

I hava a CI application that has a dashboard to manage the pages. Sometimes I get an error 403 and an error 500 in somepages, but refreshing or accessing again this page, the page works correctly. Apparently this occur just in the pages of the dashboard.

Thank you.
You need to explain what your problem is an any errors that you are getting.
I'm using google chrome (Version 56.0.2924.87 64-bit), and I go to my application, but sometimes, I can't tell when or which page, gives me an access denied error, and sometimes it works perfectly. If I get an error and then refresh the same page, this page works perfectly.

The imagem ( [attachment=809] ) show the error I get just right now.

The imagem ( [attachment=810] ) show same page that gives me the error before, just refreshed and working.
I am also running Chrome x64 and do not have this problem, can you use the advanced forum editor and show the code for your form?

I am running Windows 10 Pro x64
It's possible something on the server is offline and after my request it's initialized and become online, like a service? Because after the first error on the page, the error takes some hours to occur again. I'm using a free hosting service.

Later I will show the code. I'm at work right now, and the code is in my personal notebook.

Thank you.
Check you php log and see what the 500 error is.
How can I check this PHP log, please?
What environment are running in? Xampp, linux?
I think it's running in a linux instance. Apache version 2.4 and PHP version 5.5.

This is the controller PainelDeControle.php:

defined('BASEPATH') OR exit('No direct script access allowed');

class PainelDeControle extends CI_Controller {

 public function index()
   if (usuarioLogado()) {
   } else {
     $this->session->set_flashdata("mensagem-fracasso", "Acesso negado. Nenhum usuário logado.");


In the index() function the else statement is executed, because there's no user yet defined.
According to the documentation I think you need to upgrade your PHP version.

PHP version 5.6 or newer is recommended.
Pages: 1 2