[eluser]Unknown[/eluser]
I am currently developing a cms system and I have coded my own simple Auth library.
Nothing fancy, but I wanted to check if things are secure enough.
When a user logs in, the lib sets some session attributes. One of them is "isLoggedIn" set to TRUE. This one I use in the "checkIfLoggedIn()" function.
Now; I have made a function which also checks if the user has logged in and if not; does a redirect to the login page:
Code:
function checkLogin() {
if(!$this->isLoggedIn()) {
$CI =& get_instance();
$CI->load->helper('url');
redirect('admin/login', 'refresh');
}
}
On the page I want to secure I use this: (controller)
Code:
function index() {
$this->load->library('authLib');
$this->authLib->checkLogin();
echo "Here goes the rest of the code if you have logged in.";
}
Is this way of working secure enough or do I need to provide some extra security?