ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem with getting userdata from codeigniter session which has been stored in DB

July 20, 2014 1:53am

Subscribe [1]
  • #1 / Jul 20, 2014 1:53am

    aminb

    1 posts

    Hi,

    I just enabled saving sessions in DB:

    $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:

    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

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases