重定向后会话值丢失。我正在从 pay_order 方法重定向到 do_payment 方法。当我在 do_payment 方法中打印会话值时,它返回 false。只需简单调用 do_payment 方法即可显示会话值。请帮助重定向..有什么问题?
function pay_order($order_id)
{
$this->load->helper('url'); //loading url helper
$this->load->library('session');//loading session lib
$this->load->library('cart'); //loading cart lib
$this->load->helper('form');//loading form helper
$output = $this->cart->contents();// getting data from cart.
$output = $this->sort_array($output);// sorting the array
$list['data'] = $output;
$list['order_id'] = $order_id;
$this->session->set_userdata('abc', $list);// setting the session
redirect('checkout/do_payment'); // redirecting to do_payment
}
function do_payment()
{
$this->load->helper('url'); //loading url helper
$this->load->library('session'); //loading session library
$arr = $this->session->userdata('abc');// getting session data in $arr
var_dump( $arr );// return false value.
//$this->load->view('order/pay_through_gateway');
}
当我从 pay_order 方法重定向时,会话在 do_payment 方法中不可用。为什么?