Welcome Guest, Not a member yet? Register   Sign In
What do I not understand about flashdata? specifically keep_flashdata
#1

[eluser]skattabrain[/eluser]
I thought I understood how flashdata works perfectly but this morning i"m stumped ... maybe I need more coffee.

So the gist of this is...

1 - customer places order
2 - process order and set flashdata for the thank you page
3 - user redirected to thank you page

and ...

4 - if user hit's 'refresh' i can still serve the thank you page
5 - otherwise, i load a different view and verify they are logged in and have access to view the order.

4 & 5 no workie.

so the first view works great, but after that it keeps loading the myaccount/order_view view.

so ... the order process function (minus all the work) ...

Code:
function process()
{
   // blah blah blah
   $this->session->set_flashdata('just_placed_order', 'yes');            
   redirect('order/view/'.$order_id.'/'.$order_hash);
}

and then the view function ...
Code:
function view($order_id='', $order_hash='')
{
   // do stuff

if($this->session->flashdata('just_placed_order'))
{
$this->session->keep_flashdata('just_placed_order');
$this->load->view('thank_you_order', $d);
}
else
{
$this->load->view('myaccount/order_view', $d);
}
}




Theme © iAndrew 2016 - Forum software by © MyBB