Since someone emailed me off the list to inquire about this, I thought
I'd post my fix for the problem for those who find this in the future.
Here's what I wrote in my email:

It turned out that I had moved some code in the layout that was trying
to check against Auth. I have this code in my app_controller.php file:

function beforeFilter(){
        if ($role = $this->Auth->user('role')) {
            $this->set('user_info', $this->Auth->user());
        }
    }

I check for that $user_info variable in the layout. I'm not sure
exactly what caused the problem but I'm pretty sure that was the root
of it. Here's what the layout has:

if (isset($user_info)) {

// display the username and some other info

}

I was modifying the layout and put that part of the code at the very
beginning. The effect was that the code was run before the page could
be rendered so that even when I went to log in, it was being checked,
thus trying to redirect me toward the login page. I think it went
something like this:

   1. I tried to access a page that was protected by Auth.
   2. I was redirected to the login page
   3. The login page tried to check for $user_info which wasn't set
because I hadn't logged in. Since it was checking before the page
rendered, it kept redirecting without ever rendering the page until
Firefox decided that it was an infinite loop (it was) and stopped
trying.


At least I think that's what was happening. As soon as I moved that
section down into a part of the page that would be run after the page
started to render, it solved my problem. It was bizarre. You wouldn't
think that modifying a layout would send the application into an
infinite loop. In retrospect it makes sense if my understanding of the
problem is correct. In any case, the problem was solved.

On Mar 11, 4:07 pm, Tony Thomas <[email protected]> wrote:
> I've been working on a local copy of my CakePHP app that runs on a my
> computer. Today I've only been working on a layout and the style
> sheet. I took a break and went back to it which prompted a new login.
> Suddenly I'm getting aredirectloop. Firefox gives me this following
> message:
>
> RedirectLoop
>
> Firefox has detected that the server is redirecting the request for
> this address in a way that will never complete.
>
> The browser has stopped trying to retrieve the requested item. The
> site is redirecting the request in a way that will never complete.
>
>     * Have you disabled or blocked cookies required by this site?
>     * NOTE: If accepting the site's cookies does not resolve the
> problem, it is likely a server configuration issue and not your
> computer.
>
> Any thoughts on what might cause that if I wasn't working in the a
> controller? More importantly, how do I fix it?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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