You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
World Wide Web Server edited this page Jul 4, 2012
·
6 revisions
I have been toying around for weeks on the best solution on how to check for session data before allowing the user to access admin sections of their website.
Today I played around with creating a helper function that will do just that.
Controller (admin_panel.php)
[code]
<?php
Class Admin_panel extends Controller {
function Admin_panel() {
parent::Controller();
//check to make sure username is set in session
check_sessions();
}
function index() {
$this->load->view('admin_panel_view');
}
}
?>
[/code]
Take note that I am auto loading my helper file in autoload.php