What is the lifecycle of a CakePHP request?

Viewed 2811

Spoiler: I'd like to better understand the lifecycle of a request to a CakePHP app.

Background: I'm on CakePHP v2.3. I'm debugging a problem that results in an undesired redirect which I can't find. I'm trying to work my way through the lifecycle of the request by incrementally adding die() to try to identify where the redirection is getting triggered.

I hit a dead end because I can kill the execution from inside the controller's beforeFilter(), but the redirect happens if I move the die() into the actual action.

So my specific question is: what happens after the beforeFilter but before the action? I know of beforeRender(), which had no effect when I placed the die() there.

My more general / better question is: is there documentation for the full lifecycle of a CakePHP request?

An answer to either of these would be great.

Update

Thanks to Mathew F.'s helpful suggestions, I'm focusing my attention on the Auth component because it's almost the only candidate and the redirect I'm debugging looks like it's handiwork (the user arrives at the authRedirect location). However, when I trie to die() at the top of the AppController's isAuthorized() nothing happens. And my controller has no isAuthorized() of its own. So this leaves me a bit stumped again.

2 Answers
Related