Error 310 (net::ERR_TOO_MANY_REDIRECTS):

33,800

Solution 1

I'm guessing you get an infinite redirect loop: you get redirected to admin/index, this same code snippet is run again, redirecting to admin/index ad infinitum. You probably want to add a check to that snippet and only do the redirect if you're NOT on the admin/index page.

Solution 2

You should not use redirect() function in your class's __construct().

Share:
33,800
Kimberly Mullins
Author by

Kimberly Mullins

Updated on September 12, 2020

Comments

  • Kimberly Mullins
    Kimberly Mullins over 3 years

    What is this error:

    Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
    

    I use PHP CodeIgniter and library SimpleLoginSecure, this is my code:

    if ($this->session->userdata('logged_in')) {
        redirect('admin/index');
    }
    

    How can I resolve this error?

    Regards