Welcome Guest, Not a member yet? Register   Sign In
Session proper config?
#4

(03-11-2016, 06:35 AM)keulu Wrote: it's because you don't affect key to your session array.

In your case, you can access to your vars like that.
PHP Code:
$username $this->session->username;
$email $this->session->email;
$logged_in $this->session->logged_in


if  you want to get your complete array, set your session with a key
PHP Code:
$newdata = array(
 
       'username'  => 'johndoe',
 
       'email'     => '[email protected]',
 
       'logged_in' => TRUE
);

$this->session->set_userdata('newdata'$newdata);
// OR
$this->session->set_userdata(array('newdata'=>$newdata)); 

you can check if a key is available with
PHP Code:
$this->session->has_userdata('newdata'); // (false in your case) 

thanks dude very helpful.

The document is very confusing.
https://codeigniter.com/user_guide/libra...ssion-data

Can someone please update the document.
Thanks in advanced.
No SEO spam
Reply


Messages In This Thread
Session proper config? - by solidcodes - 03-11-2016, 05:53 AM
RE: Session proper config? - by keulu - 03-11-2016, 06:35 AM
RE: Session proper config? - by solidcodes - 03-11-2016, 12:21 PM
RE: Session proper config? - by salain - 03-11-2016, 07:19 AM
RE: Session proper config? - by InsiteFX - 03-30-2016, 01:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB