title: How to use the global variable in Codeigniter?
body: <pre><code>    &lt;?php
      class chargemen extends CI_Controller
      {
          public function __construct()
          {
              parent::__construct();
          }
  
      public $jobs_session=array(); 
  
      public function set_jobs($array)
      {
      $this-&gt;jobs_session=$array;
      }
      public function get_jobs()
      {
      return $this-&gt;jobs_session; //when i'm acessing this functions it returns null array
      }
      public function form()
      {
      $a=$this-&gt;input-&gt;post();
      $this-&gt;set_jobs($a); 
  }
  
    ?&gt;
  </code></pre>
  
  <p>Is it possible to acess global variables in ci, i'm tryng to access it, but it returns <code>null array</code>.can u plz help me to acess it or suggest a best way to keep the data without using sessions n cookies</p>