Welcome Guest, Not a member yet? Register   Sign In
Problem with getting userdata from codeigniter session which has been stored in DB
#1

[eluser]Unknown[/eluser]
Hi,

I just enabled saving sessions in DB:
Code:
$login_info=array('logged_in_user_id' => $user_result['u_id'],
'logged_in_username'=> $user_result['u_username']);

$this->session->set_userdata('login',$login_info); // after this the session will be stored in db but I cant have access to it..

But I have problem with this code:
Code:
if(!empty($this -> session -> userdata('login')))
{
    echo "login true";
} else {
    echo "login false"; // I always get this one!
        }

according to my above explanation:

1- is it a secure way for manipulating login process in codeigniter?
2- What should I do to get the db session data and get rid of the problem above?

Your answer is appreciated,

Warm regards


Messages In This Thread
Problem with getting userdata from codeigniter session which has been stored in DB - by El Forum - 07-19-2014, 11:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB