title: codeigniter session working on local host but not working on server and also sit
body: <p>Hi Friends I am struggling session in codeigniter everything working fine my system but server or sit machine not working session  </p>
  
  <pre><code>public function voting() {    //like and dislike controller 
  
          $deal_id = $this-&gt;input-&gt;post('voteId');
          $upOrDown = $this-&gt;input-&gt;post('upOrDown');
          $session_id = $this-&gt;input-&gt;post('session_id');
         $voted_id = $this-&gt;session-&gt;userdata('voted');
          $voted_deal =$this-&gt;session-&gt;userdata('voted_deal');
  
          if ($voted_id == $session_id &amp;&amp; $voted_deal == $deal_id) 
          { //defult session id voted id equla return 2
  
              echo 2; // it important for already voted or not checking purpose
          }
          else 
          {
  
              $status = "false";
              $updateRecords = 0;
  
              if ($upOrDown == 'upvote')
              { //like vote
  
                  $updateRecords = $this-&gt;consumer_model-&gt;updateUpVote($deal_id);
              } 
              else 
             { //dis like vote
  
              $updateRecords = $this-&gt;consumer_model-&gt;updateDownVote($deal_id);
            }
            if ($updateRecords &gt; 0) 
            { //updaterecords greaterthan zero return true and set the defult session id
  
               $this-&gt;session-&gt;set_userdata('voted_deal',$deal_id);
                $voted_deal=$deal_id;
                $voted_id = $session_id;
               $this-&gt;session-&gt;set_userdata('voted', $voted_id);
                $status = 1; 
            }
  
            echo $status;  // return status it important for voted sucessfully message
          }
      }
  </code></pre>
  
  <p>the above code is working to me but not working on server.you notice this i am auto load the session library </p>