I have an app that uses CakeSession for saving different user data. Now I want to write some default values using CakeSession::write() and have them available for all views (also for cached views). So the check/write should be done on every request before the view is rendered.
But where to put the code to match these requirements? Until now, I tried the following positions to use CakeSession::write() but without success:
- Config/bootstrap.php -> CakeSession is not defined yet
- AppController::__construct() -> CakeSession is not defined yet
- AppController::beforeFilter() -> will not be called for cached views
'callbacks'=>trueas a param ofcacheActionwhich fires thebeforeFilter. - Ross