There is a session helper for this exact purpose.

if ($session->check('myvar')){
 echo 'value found';
}

or

echo $session->read('myvar');

It might be autoloaded if you use the session component - can't
remember.

Cheers,
Adam

On Feb 22, 10:50 am, Raistlin Majere <[EMAIL PROTECTED]> wrote:
> I was not logged in, then I visited a page with "if
> (empty($_SESSION))", but "echo $_SESSION" displayed "Array" in that
> page!
>
> If I am not logged in, why is there a $_SESSION in views? The manual
> is telling me how to check session in controller, before all actions
> in controller and before a single controller action, but I need to
> check session in views! How can I do that?
>
> (AppServ 2.5.9
> Apache 2.2.4
> PHP 5.2.3
> MySQL 5.0.45
> phpMyAdmin-2.10.2
> CakePHP 1.1.19.6305)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to