Make sure you have included the Session component and helper, and then refer to 
them as $this->Session. in fact, refer to everything in the same way 
($this->Form, $this->Html etc).

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 22 Sep 2010, at 16:16, psybear83 wrote:

> Hi everybody
> 
> I'm upgrading to v1.3 and have some problems I couldn't figure out
> yet...
> 
> In my layouts/default.ctp I have the following code:
> 
>                       <?php
>                       if ($session->check('Message.flash')) {
>                               $session->flash();
>                       }
>                       if ($session->check('Message.auth')) {
>                               $session->flash('auth');
>                       }
>                       ?>
> 
> Sadly this raises the following error:
> 
> Notice (8): Undefined variable: session [APP/views/layouts/
> default.ctp, line 103]
> include - APP/views/layouts/default.ctp, line 103
> View::_render() - CORE/cake/libs/view/view.php, line 723
> View::renderLayout() - CORE/cake/libs/view/view.php, line 482
> View::render() - CORE/cake/libs/view/view.php, line 428
> Controller::render() - CORE/cake/libs/controller/controller.php, line
> 913
> AppController::__renderIndex() - APP/controllers/app_controller.php,
> line 602
> AppController::index() - APP/controllers/app_controller.php, line 545
> ApplicationsController::index() - APP/controllers/
> applications_controller.php, line 18
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> [main] - APP/webroot/index.php, line 83
> 
> Fatal error: Call to a member function check() on a non-object in /
> Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103
> 
> Anyone knows why $session is not available here?
> 
> Thanks,
> Josh
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to