2013-09-26 83 views
2

喜的朋友,我的笨样样精的工作我的系统,但服务器挣扎会话或坐机不工作会议笨会议工作本地主机上,但不工作的服务器,也坐

public function voting() { //like and dislike controller 

     $deal_id = $this->input->post('voteId'); 
     $upOrDown = $this->input->post('upOrDown'); 
     $session_id = $this->input->post('session_id'); 
     $voted_id = $this->session->userdata('voted'); 
     $voted_deal =$this->session->userdata('voted_deal'); 

     if ($voted_id == $session_id && $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->consumer_model->updateUpVote($deal_id); 
      } 
      else 
      { //dis like vote 

      $updateRecords = $this->consumer_model->updateDownVote($deal_id); 
      } 
      if ($updateRecords > 0) 
      { //updaterecords greaterthan zero return true and set the defult session id 

      $this->session->set_userdata('voted_deal',$deal_id); 
       $voted_deal=$deal_id; 
       $voted_id = $session_id; 
      $this->session->set_userdata('voted', $voted_id); 
       $status = 1; 
      } 

      echo $status; // return status it important for voted sucessfully message 
     } 
    } 

上面的代码工作我但不能在server.you通知工作这个我自动加载Session库

+0

它给出了任何错误或什么? –

+0

你检查了你的会话初始化吗? –

回答

4

尝试一些替代品可能工作:
改变这些线application/config/config.php:

$config['sess_cookie_name'] = 'cisession';  //remove(underscore) 
$config['cookie_domain'] = ".example.com"; //make it site wide valid 
相关问题