If I remember right, afterFilter is not called on redirect. Cake team have some reasons for it.
On Sep 17, 6:51 pm, Ace <[email protected]> wrote: > Hi, > > I have strange problem with cakephp session. I have few controllers > that needs date changing logic for the stats so I moved all the needed > methods to app_controller. Since then I struggle with a problem of > losing session data. The main idea is simple: date is being kept in > the session, in beforeFilter I've got: > > $this->time=$this->Session->read('time'); > > and in afterFilter: > > $this->Session->write('time',$this->time); > > Every modification of time variable should be saved to the session as > you can see, but it is getting wiped out with every redirect.. during > the battle, I've figured out that if I add ob_start() at the begining > of AppController::beforeFilter() and ob_flush() at the end of > AppController::afterFilter() then it works fine. At that time I was > satisfied with the result, but the problem came back when I changed > debug level to 0. Research showed that cake is losing session data if > debug level is 0 or when it is higher but there is no output buffering > added to the before and after filters of the AppController. > > Anybody has any clue why is that? And how this can be fixed? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
