Welcome Guest, Not a member yet? Register   Sign In
storing session in the application using codeignitor
#1

[eluser]Unknown[/eluser]
I am trying to create a CMS site using codeignitor. For which I am creating admin panel. Now I have created login system and when the user assigns correct username and password, it will view the inner page. But I am having problem as I need to make it secure and the user which will sign in needs to maintain in session till log out. So how to maintain session and make it available in all the pages and if session is not there it should redirect to the login page.

I have done this with OOP PHP but it seems completely different with codeignitor. So anyone plz help. I need to finish this on time. Thanks on advance.:grrr:
#2

[eluser]skunkbad[/eluser]
You should look at "Sessions" in the user guide. It will tell you everything you need to know.
#3

[eluser]Unknown[/eluser]
I had but what I need it doesnot tell. Its says how to initialize sessions only.
#4

[eluser]InsiteFX[/eluser]
Code:
$data = array(
    'username' => $row->username,
    'user_id' => $row->id,
    'group_id' => $row->group_id,
    'logged_in' => TRUE
);

$this->_ci->session->set_userdata($data);




Theme © iAndrew 2016 - Forum software by © MyBB