cookie('pro',null);居然只在首页有效

浏览:756 发布日期:2015/07/01 分类:求助交流
COOKIE打印出来是这样的:Array
(
    [thinkphp_show_page_trace] => 0|0
    [PHPSESSID] => hfvpbvlrbvbr4bvlrbvof746fjg7
    [pro] => Array
        (
            [1095] => 1095|1
        )

)
,我想把cookie里面的pro清空,用cookie('pro',null);放到首页控制器index,立马见效,但是放到其他地方的控制就失效,直接跳过了,比如在这个控制器里面://取消订单
        public function cancel_order(){
            $ordid=I('ordid');
            $uid=$_SESSION['uid'];
            if(M('orderlist')->where(array('uid'=>$uid,'ordid'=>$ordid))->delete()){
                cookie('pro',null);
                M('cart')->where(array('uid'=>$uid))->delete();
                $this->redirect('Member/order');
            }else{
                $this->error('删除失败,请重试!','',2);
            }
        }
前后语句都运行了,就跳过了cookie('pro',null);这个,请问可能是什么原因?
最佳答案
评论( 相关
后面还有条评论,点击查看>>