You're right about the error Cricket. I wasn't seeing it at first. With debug set to 1,2, etc. it simply seems as though the request was ok and view just did not load correctly. When debug is set to zero Firebug reports a 404 page not found error every time the view does not load. There's doesn't seem to be any rhyme or reason for when it happens ... it's a roll of the dice, sometimes it fails, sometimes it don't. I was reading somewhere that in 1.2 there is a bug in Controller::redirect(); ?
To be quite honest I'm not even sure how and why I ended up using redirects ... it just sort of ended up that way after experimenting with 101 tutorials and examples. I've since stripped it back down and went back to my initial idea. The way that it is now (and was originally) is that the view for the login area is loaded into the default view via $this->element. The login element is set up that if the session is not set it displays the login form, if it is set it displays other info plus the link to logout. I have views/users/login.ctp set up identically to the login element which is pretty much only viewable when the form is submitted ... the rest of the time element/login is being displayed. As it is now the login view loads nearly every time and and the logout fails nearly every time. It makes me wonder because while there are no longer any redirects in the login action but logout still contains $this->redirect($this->Auth->logout());. The reason it makes me wonder is because when the problem initially started it was the exact opposite ... login would fail and logout worked every time. I think I'm going to strip it all down again and start over with it. Perhaps I'll being able to tell what's causing the issue by rebuilding it one piece at time. My new analogy: "Websites are like automobiles ... do you really want to drive one that works 'most' of the time? " - Ed On Wed, Apr 7, 2010 at 12:15 PM, cricket <[email protected]> wrote: > On Apr 7, 2:32 am, Ed Propsner <[email protected]> wrote: > > I actually just scripted a new function into the controller and let it > cache > > the page with the new change and then added the login function back in > > afterwards and there was no issues. > > > > I'm stuck on an Ajax login ... have been for a while now. Been through > the > > book, API, countless tutorials, etc. Still no luck. > > > > I don't have an individual page for login ... I included the login right > > into the default layout via [code] $this->element('login'); [/code] > > > > The form submits just fine and the user gets logged in ... it's not > > redirecting to the view that I want it to. Right now it's acting as there > is > > no request handler and it's loading the entire default view into the div > I > > want to update. > > I've seen this before. If Cake throws an error the AJAX routine gets > back an entire page. > > But do you want it to redirect? If it's an AJAX request you should be > rendering a view, not redirecting to it. > > > 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 [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > > To unsubscribe, reply using "remove me" as the subject. > 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 [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
