Codeigniter passing sess_expiration time dinamically to session lib
i would like to pass dinamically the config sess_expiration time to the session lib before creating session cookie , but if i do :

    if($this->request->isAjax()){
              $error = false;
              $error_message = false;
              $confirm_login = false;

              $email = $this->input->post('email',true);
              $password = md5($this->input->post('password',true));
              $remember_me = $this->input->post('remember_me',true);
              if($remember_me == 1){
              $this->config->config['sess_expiration'] = 0;
              }
              $this->load->model('model_user');
              $what = array(
                  'email'=>$email,
                  'password'=>$password,
                  'confirm'=>'1'
              );

              $user = $this->model_user->populateBy($what);
              if(count($user) > 0){

              $confirm_login = '1';

              $userSession = array(
                  'user_id'=>$user->id,
                  'user_username'=>$user->username,
                  'user_email'=>$user->email
              );
               $this->session->set_userdata($userSession);
                echo json_encode(array(
                  'confirm_login'=>$confirm_login,
                  'error_login'=>$error_message,
                  'username'=>$user->username,
                  'user_link'=>site_url('users/id/'.$user->id.'/'.$user->username)
              ));
              }

it doesn't take care of the directive and always sets a 7200 sess_expiration standard cookie :(

i need it for the login remember me feature :(
Codeigniter passing sess_expiration time dinamically to session lib
===

i would like to pass dinamically the config sess_expiration time to the session lib before creating session cookie , but if i do :

    if($this->request->isAjax()){
              $error = false;
              $error_message = false;
              $confirm_login = false;

              $email = $this->input->post('email',true);
              $password = md5($this->input->post('password',true));
              $remember_me = $this->input->post('remember_me',true);
              if($remember_me == 1){
              $this->config->config['sess_expiration'] = 0;
              }
              $this->load->model('model_user');
              $what = array(
                  'email'=>$email,
                  'password'=>$password,
                  'confirm'=>'1'
              );

              $user = $this->model_user->populateBy($what);
              if(count($user) > 0){

              $confirm_login = '1';

              $userSession = array(
                  'user_id'=>$user->id,
                  'user_username'=>$user->username,
                  'user_email'=>$user->email
              );
               $this->session->set_userdata($userSession);
                echo json_encode(array(
                  'confirm_login'=>$confirm_login,
                  'error_login'=>$error_message,
                  'username'=>$user->username,
                  'user_link'=>site_url('users/id/'.$user->id.'/'.$user->username)
              ));
              }

it doesn't take care of the directive and always sets a 7200 sess_expiration standard cookie :(

i need it for the login remember me feature :(