I'm using CakePHP 2.6
I'm having a problem when I redirect back to the same view from where the request was made. The view seems to be cached, so whatever changes were made during the request are not shown until the page is refreshed again.
This means:
- the user can't see the changes just made.
- Flash messages are shown on the following view (which is bad).
Why is this happening?
Things I've checked:
- My PHP environment has caching turned off
- My CakePHP configurations are the defaults (see below).
- Caching should be disabled because I'm in debug mode:
Configure::write('debug', 2);
- I'm testing in multiple browsers with and without browser caching enabled.
Configure::write('Session', array(
'defaults' => 'php'
));
Representative example:
//Inside ListingsController...
$this->Listing->id = $id;
if ($this->Listing->save($listing)) {
$this->Flash->success(__('"%s" is now active.', $listing['Listing']['title']));
} else {
$this->Flash->error(__('Problem activating'));
}
//this is the original view...
$this->redirect( array('controller'=>'listings', 'action'=>'mylistings') );