Welcome Guest, Not a member yet? Register   Sign In
ci_session table problem
#2

[eluser]Unknown[/eluser]
i found my problem but i didn't solve. Somebody can help me ?

Get data from DB in model functions. When i use session table to set this data in session, data is empty. Like this;

Without ci_session table run is normal

Code:
class Proje extends Controller {

function Proje()
    {
        parent::Controller();
        $this->load->model('Proje_model');
        $this->load->model('Genel_model');
        
        $this->load->helper('cookie');
        $this->load->library('session');

        //$this->session->set_userdata('username', $_SERVER['REMOTE_USER']);
        $this->session->set_userdata('username', 'UB7163');
        
      
        [b]$data = $this->Genel_model->getKullaniciBilgi(); //DATA VALUES FROM DB TABLE[/b]

/* this data from db by model function (select * from table). This code is run properly without using ci_session table */


        $this->session->set_userdata('kullanicibilgi', $data);
        
        $usr = $this->session->userdata('kullanicibilgi');

        $this->session->set_userdata('userbirim', $usr[0]['BIRIM_NO']);
        $this->session->set_userdata('useradsoyad', $usr[0]['AD']);


}

for ci_session table code;

Code:
class Proje extends Controller {

function Proje()
    {
        parent::Controller();
        $this->load->model('Proje_model');
        $this->load->model('Genel_model');
        
        $this->load->helper('cookie');
        $this->load->library('session');

        //$this->session->set_userdata('username', $_SERVER['REMOTE_USER']);
        $this->session->set_userdata('username', 'UB7163');
        

$data = array(
                array ( AD=>"Ensar Kal",
                        BIRIM_NO=>95,
                       )
);

/* if i se static array instead of db array ([b]$data = $this->Genel_model->getKullaniciBilgi();)ci_session table is run properly and data written in ci_session table */


        $this->session->set_userdata('kullanicibilgi', $data);
        
        $usr = $this->session->userdata('kullanicibilgi');

        $this->session->set_userdata('userbirim', $usr[0]['BIRIM_NO']);
        $this->session->set_userdata('useradsoyad', $usr[0]['AD']);


}

i must use data from db and use ci_session table because of session limitation (4K)

help me.


Messages In This Thread
ci_session table problem - by El Forum - 05-26-2009, 01:58 AM
ci_session table problem - by El Forum - 05-26-2009, 07:11 AM
ci_session table problem - by El Forum - 05-27-2009, 01:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB