Hi Ben, everybody,
Good morning / good evening (whatever is applicable) to all of you. I have been developing a web application locally using CI and Ion Auth - I’m still a newbie to both though. Anyway, I encountered the following problems upon deploying the application to the web hosting service I subscribed to, they were not observed in the development environment (my computer running wampserver). At first I had an issue with the database but its solved already
Now, I noticed a problem during page load / login screen (when running on the web server), the application keeps on “redirecting” to auth/login and does it forever or until I hit the stop button, its like this:
http://mysite.com/auth/auth/auth/auth/auth/auth/auth/auth/auth/auth/auth/login.html
So I tweaked the auth/index function from:
if (!$this->ion_auth->logged_in())
{
//redirect them to the login page
redirect('auth/login', 'refresh');
}
to
if (!$this->ion_auth->logged_in())
{
//redirect them to the login page
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
$this->data['email'] = array('name' => 'email',
'id' => 'email',
'type' => 'text',
'value' => $this->form_validation->set_value('email'),
);
$this->data['password'] = array('name' => 'password',
'id' => 'password',
'type' => 'password',
);
$this->load->view('login', $this->data);
}
It seem to have solved the issue so I thought everything was ok already until I tried to login. It doesn’t matter if I logged in correctly or not, the page will just always return to the login screen - plus no flashdata are shown when they normally should be flashed. I checked the database, sessions are created but the user_data remains blank. Could you please advice me on what I might have missed? Thank you so much in advance!