> > I'm looking for a way to set the cookie and session for > admin routes only >
1. // called before every single action 2. function beforeFilter() { 3. // if admin pages are being requested 4. if(isset($this->params['admin'])) { 5. // check the admin is logged in 6. // this method is in the app_controller.php file 7. $this->checkAdminSession(); 8. } 9. } http://www.jamesfairhurst.co.uk/posts/view/creating_an_admin_section_with_cakephp/ On 24/04/2008, lance <[EMAIL PROTECTED]> wrote: > > > What is the advantage of saving a cookie and session information for a > public CakePHP app (just the public-facing views, not admin views). > Why should I save this information if there is no user data or > preferences to keep track of? > > I know for the admin views it's important to keep user info for log in > and authentication purposes, and also to show Session messages (flash, > errors). But for a read-only public view with no messages, no error > validation, it's not needed right? > > Unless it's a recommended practice to always set cookies and save > sessions, I'm looking for a way to set the cookie and session for > admin routes only -- maybe as a beforeFilter type action? Right now I > just disabled sessions and cookies in the core.php config file, but > I'd prefer to enable just for the admin views. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---