public function login() { if($this->input->server('REQUEST_METHOD') == 'GET'){ if(isset($this->session->login)){ $this-> output ->set_output(json_encode(array('status' => 'true', 'data' => 'login seccess'))); }else{ $this-> output ->set_output(json_encode(array('status' => 'true', 'data' => 'please login'))); } } else if ($this->input->server('REQUEST_METHOD') == 'POST'){ $newdata = array('login' => 'logged' ); $this->session->set_userdata($newdata); $this-> output ->set_output(json_encode(array('status' => 'true', 'data' => 'please login 2'))); }
POST到一个地址成功后,不是设置好了SESSION了吗?然后我再GET地址,没有返回 login seccess!哪里出了问题?
cookie呢?