开发者

my session_id changes, and the session does not save the data

开发者 https://www.devze.com 2023-03-07 16:34 出处:网络
here are the parts that i think are relevant: EDIT: when i use regular $_SESSION - evrything works...

here are the parts that i think are relevant:

EDIT: when i use regular $_SESSION - evrything works...

function A saves the session data, than calls a view, that returns the data the user added to it to function B. both func开发者_StackOverflowtion A and function B are on the same controller. im using 2.0.2 version.. so when it also asked me to enter encryption key in the config file.

the problem is, that the session don't save the data when i move between the pages.. i also noticed that it changes the session_id varible...

do you know what am i doing wrong?

another important information - i return a value threw the URL to function B.

controller welcome: functionA

                    ...
        $data = array(
            'username' => $myusername,
            'is_logged_in' => true,
            'permissions' =>$permissions
        );
        $this->session->set_userdata($data);
                    ...
                    ...
                    $this->load->view('login_success',$dataV);

controller welcome: functionB

          $user=$this->session->userdata('username');       
          echo "<br> IN LINK REFERENCE: $user";

do you know what am i doing wrong?


Not sure, but looks like you haven't initialized your Session library. Can you please check if you have initialized Session library correctly? Please check $autoload['libraries'] = array(); in config/autoload directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消