Hello everyone.

I have some trouble with Auth when using caching of main page.
I want that users will auto-login when they open main page. Login of
auto login from cookies implemented in AppController::beforeFilter:

if (!$this->Auth->user())
{
        $cookie = $this->Cookie->read('Auth.User');
        if (!is_null($cookie)) {
                if ($this->Auth->login($cookie)) {
                        $this->Session->del("goBack");
                        $this->Session->del('Message.auth');
                }
        }
}

But when users open cached first page CakePHP not execute
beforeFilter. When user goes to no-caching page beforeFilter executing
and he login automated.
Problem here(layout/default.ctp)

<cake:nocache>
        <?
        if ($session->read("Auth.User.role") == 'accepted')
        {
                echo $this->element('user_menu');
        }
        ?>
</cake:nocache>

So user dont see menu before he go to another page =(

Any solution?
I see two ways:
1. How i can use Auth, Cookie and Session components from my layout?
ClassRegistry::init(...) didnt work here =(
2. Any actions in controllers are called when opens Cached page?

Big sorry for my english language =/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to