Welcome Guest, Not a member yet? Register   Sign In
get session data
#11

[eluser]Atharva[/eluser]
[quote author="Aspi" date="1301059187"]THX everybody help

i try $roles = $this->session->userdata('roles'); nothing happen
and i try $roles = $this->session->userdata('user_data'); nothing happen

if i try $roles = $this->session->userdata('session_id'); show session id

is very frustrating userdata('roles') don't return any information.

and another question is i must unserialize userdata('roles') ?

THX[/quote]

Just making sure, are you storing the data into session using set_userdata function?
Code:
$newdata = array(
                   'username'  => $data['username'],
                   'roles' => $data['roles'],
                   'logged_in' => TRUE
               );
$this->session->set_userdata($newdata);

@virtualgadjo , there is no function like 'newsdata'
#12

[eluser]videoinspector[/eluser]
videoinspector
[quote author="Atharva" date="1301070938"][quote author="Aspi" date="1301059187"]THX everybody help

i try $roles = $this->session->userdata('roles'); nothing happen
and i try $roles = $this->session->userdata('user_data'); nothing happen

if i try $roles = $this->session->userdata('session_id'); show session id

is very frustrating userdata('roles') don't return any information.

and another question is i must unserialize userdata('roles') ?

THX[/quote]

Just making sure, are you storing the data into session using set_userdata function?
Code:
$newdata = array(
                   'username'  => $data['username'],
                   'roles' => $data['roles'],
                   'logged_in' => TRUE
               );
$this->session->set_userdata($newdata);

@virtualgadjo , there is no function like 'newsdata'[/quote]

why is bug?
#13

[eluser]InsiteFX[/eluser]
For one your saving an array into the userdata array.

So if you do a
Code:
$roles = $this->session->userdata('roles');

$roles should contain the array roles!

Code:
var_dump($roles);

And see what you get!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB