0

我已经设置了这样的会话

$loc_details = array(
                   'maincity_id'  =>$maincity_id,
                   'mainzoneid'     => $mainzoneid,
                   'mainproductid'     => $productid,
               );
        $this->session->set_userdata($loc_details);

在这里我检索到这样的值

$maincity_id=$this->session->userdata('maincity_id');

    //$mainzone_id=$this->session->userdata('mainzone_id');
        $mainproduct_id=$this->session->userdata('mainproductid');

但是如果我看到输出,则会话未设置,任何人都可以帮助解决这个问题

4

1 回答 1

1

你需要这样做…………

$loc_details = array(
               'maincity_id'  =>$maincity_id,
               'mainzoneid'     => $mainzoneid,
               'mainproductid'     => $productid,
           );

 $this->session->set_userdata('loc_details',$loc_details);

 $loc_details = $this->session->userdata("loc_details");

 $maincity_id = $loc_details['maincity_id'];

 $mainproduct_id = $loc_details['mainproductid'];
于 2013-04-10T05:27:52.153 回答