Part of the EllisLab Network
   
 
What do I not understand about flashdata? specifically keep_flashdata
Posted: 06 October 2008 10:23 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  197
Joined  01-31-2008

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) ...

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 ...

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);
}
}
 Signature 

Greg Guepy - Skattabrain Inc

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120536 Total Logged-in Users: 38
Total Topics: 126598 Total Anonymous Users: 3
Total Replies: 665552 Total Guests: 404
Total Posts: 792150    
Members ( View Memberlist )
Newest Members:  sweeper240andrew nsuntroprachel123Rach123Glenn StavaImfaelSMS!persanulandrewknight