Is this good login process in CodeIgniter?
Simply use return $this-&gt;simpleloginsecure-&gt;login($email, $password) in the login method.
redirect('/user/xxx') is enough, since location is the default redirect type.
Since you're doing a redirect(), $data['message']is probably "dead code" here. Use CodeIgniter's Flashdata instead.
&lt;p class="error"&gt; should be handled in the view, the controller only needs to say there's an error. For example: $data['message'] = array('error' =&gt; 'This is my error text');
Trimming passwords is dangerous: what if my password starts with a space? Also, a space will look like a real character in an HTML password form, it makes no sense to trim it.
When the validation fails, redirect to the login form and use flashdata to explain what got wrong.