I believe I have more or less the same problem as Jeff. I actually wanted to start a new thread when I saw this. I will detail my situation in a rather lengthy manner is it is rather strange:
I have a controller called focus which has two methods, index() and save(). You can see the code at the bottom of this post. index() displays a form. Upon clicking submit, the form calls save() which saves the new form values to the db, does a $this->Session->setFlash and then redirects back to the index() method. The index method is then supposed to display the new values as well as the Flash confirmation message. The Session->setFlash is done as described at http://wiki.cakephp.org/tutorials:flashing. My problem: well, when runnnig the site on my mac (with apache, php5 and local mysql db) everything works just fine. I am able to save data to the db, and get the flash confirmation message. When running the site on my shared hosting account (with apache, php4 and mysql db), the situation is as follows: - if I'm accessing the site on my home wireless connection, everything works just fine. - if I'm accessing the site on one of the Macs in the nearby Apple Store everything works just fine. - However, and here the trouble starts, if I try to access the site inside my school, while connected to their WiFi network I get the following behaviour: upon pressing submit, data is sent to the db and the db update happens succesfully, which means that the save() method does save the data as it should, however, the redirection to /focus shows me the cached focus page, with the old values in the form (as they were before the update) and without the flash confirmation message. If I hit refresh once (its important, just once), the flash message gets displayed and the new form values are shown. Now, after this happens, if I click focus/ in the navbar (so no hitting refresh, just clicking the link), i will once again get the flash message and I'll get it everytime when clicking the /focus link. It seems that now the page that had the flash message is in the cache and rendered. If i hit refresh again,the flash is gone. So it seems that I'm always getting a cached page, except when hitting refresh. In core.php I have the following: define('DEBUG', 3); /** * Turn of caching checking wide. * You must still use the controller var cacheAction inside you controller class. * You can either set it controller wide, or in each controller method. * use var $cacheAction = true; or in the controller method $this->cacheAction = true; */ define('CACHE_CHECK', false); /** * Turn of caching site wide according to Nate on CakePHP Google Group. * This feature is undocumented. */ define("DISABLE_CACHE", true); /** * Error constant. Used for differentiating error logging and debugging. * Currently PHP supports LOG_DEBUG */ define('LOG_ERROR', 2); /** ...etc... my focus controller is as follows: <?php class FocusController extends AppController { var $name = 'Focus'; var $layout = 'members'; var $uses = 'Focus'; function beforeFilter() { parent::beforeFilter(); $this->membersOnly(); } function index() { $this->pageTitle .= 'choose your focus'; if (!$this->data = $this->Focus->find(array('Focus.users_id' => $this->Session->read('User.id')))) { $this->data['Focus']['professional'] = 40; $this->data['Focus']['education'] = 30; $this->data['Focus']['personal'] = 30; } else { $this->data = $this->Focus->find(array('Focus.users_id' => $this->Session->read('User.id'))); } } function save() { if (!empty($this->data)) { $usrid = $this->Focus->find(array('Focus.users_id' => $this->Session->read('User.id'))); if ($usrid['Focus']['id']) $this->Focus->id = $usrid['Focus']['id']; if ($usrid['Focus']['users_id']) { $this->data['Focus']['users_id'] = $usrid['Focus']['users_id']; } else { $this->data['Focus']['users_id'] = $this->Session->read('User.id'); } if ($this->Focus->save($this->data)) { $this->Session->setFlash('Your focus mix has been saved.', 'blank'); } } $this->redirect('/focus'); exit; } } ?> HEEEELP!!! :)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
