session中类对象的保存

好象需要序列化之后才能保存,
取得时候再反序列化还原

如果不这样的话,出现 [instance of __PHP_Incomplete_Class given]错误?

                $cond = new Search_Cond_Tour();
                if ($cond_to_session) {
                        $cond->_customer_type = $_POST['customer_type'];
                        $cond->_tour_type = $_POST['tour_type'];
                        $cond->_public_flag =  $_POST['public_flag'];
                        $this->session->set_userdata('search_tour_cond',serialize($cond));
                } else {
                        $cond= unserialize($this->session->userdata('search_tour_cond'));
                }
原文地址:https://www.cnblogs.com/johnsonshu/p/2568509.html