title: Session Timeout in codeigniter dyanamicly
body: <p>I have issue regarding codeigniter Timeout . </p>
  
  <p>I know the config folder setting session timeout manually like as  l</p>
  
  <pre><code>$config['sess_expiration']      = 123;
  </code></pre>
  
  <p>but i need to the website admin manage the session time out dyanamicly in to the admin page </p>
  
  <p>please help me how to implement this logic</p>
  
  <p>i tried this logic but not working</p>
  
  <pre><code>$this-&gt;session-&gt;sess_expiration = "120";
  </code></pre>
  
  <p>Note:here i am storing database in the value. based on the database value i can set in to the session expiration time</p>
  
  <p>note 1: <code>$config['sess_time_to_update'] = 30;</code>  this value less than of session expiration time</p>
  
  <p>Total Logic code:</p>
  
  <pre><code>public function edit($id)
      {
          Assets::add_css('../plugins/forms/uniform/uniform.default.css');
          Assets::add_css('../plugins/forms/select/select2.css');
          Assets::add_css('../plugins/forms/validate/validate.css');
          Assets::add_css('../plugins/misc/qtip/jquery.qtip.css');
          Assets::add_js('../plugins/charts/sparkline/jquery.sparkline.min.js');
          Assets::add_js('../plugins/forms/uniform/jquery.uniform.min.js');
          Assets::add_js('../plugins/forms/select/select2.min.js');
          Assets::add_js('../plugins/forms/validate/jquery.validate.min.js');
          Assets::add_js('../plugins/forms/wizard/jquery.bbq.js');
          Assets::add_js('../plugins/forms/wizard/jquery.form.js');
          Assets::add_js('../plugins/forms/wizard/jquery.form.wizard.js');
          Assets::add_module_js('setting','setting'); 
          if ($_POST)
         {
              $current_date = date("Y-m-d H:i:s");
              $data = array(
                              's_meta_value' =&gt; $this-&gt;input-&gt;post('s_meta_value'),
                              'updated_on' =&gt; $current_date
                            );
              $this-&gt;setting_model-&gt;session_mng_update($data,$id);
              $session_val=  $this-&gt;input-&gt;post('s_meta_value');
             if($session_val == 0)
             {
               $this-&gt;session-&gt;sess_expiration = '0';
             }
             else
             {          
  
              $this-&gt;session-&gt;sess_expiration = "120";
            // $val1 = $this-&gt;config-&gt;item('sess_expiration');
         // print_r($val1);
              //$session_seconds = ($session_val*60);
            $val2 = $this-&gt;config-&gt;set_item('sess_expiration',50);
            $this-&gt;session-&gt;CI_Session();
           //$val1=  $this-&gt;config-&gt;set_item('sess_expiration',50);
              $val3 = $this-&gt;config-&gt;item('sess_expiration');
               print_r($val3);exit;
  
  
             }
  
              Template::redirect('setting/setting/display');
  
  
          } 
  
         $val3 = $this-&gt;config-&gt;item('sess_expiration');
          print_r($val3);exit;
          $data = $this-&gt;setting_model-&gt;session_mng_edit($id);
          Template::set('page_title', 'Edit Session Management');
          Template::set('data', $data);
          Template::set_view('setting/session_management/edit_session_management');
          Template::render();       
  }
  </code></pre>