Re: calling exit() after redirect STILL redirects

2008-11-27 Thread _Z
Hi Rafael, I have this set as: $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'index'); and the problem still persists without deleting that key. :s Thanks for the input! On Nov 27, 12:45 pm, Rafael Bandeira aka rafaelbandeira3 <[EMAIL PROTECTED]> wrote: > > De

Re: calling exit() after redirect STILL redirects

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3
> Deleting this key solved the problem. instead of deleting the session key, why don't you set the right url on AuthComponent::$loginRedirect? $this->Auth->loginRedirect = array('controller' => 'user', 'action' => 'info'); --~--~-~--~~~---~--~~ You received this m

Re: calling exit() after redirect STILL redirects

2008-11-27 Thread _Z
I have added this code to the login function: $this->Session->del('Auth.redirect'); The assessment from David was correct. Auth was redirecting to the past viewed page, except logged in :/ Deleting this key solved the problem. Thanks for your help everyone! On Nov 25, 9:02 am, mark_story <[EMA

Re: calling exit() after redirect STILL redirects

2008-11-27 Thread _Z
Hi David, Correct, both register and login work correctly. YES :) That explains it! But within my app_controller I have the Auth component redirecting to users/index after a successful login. To solve this problem, I've placed this code in my login() function: $this->Session->del('Auth.redirect

Re: calling exit() after redirect STILL redirects

2008-11-25 Thread mark_story
There is no $this->exit() function. Perhaps you are thinking of $this- >_stop()? Also in 1.2 there is no need to manually call exit(). It is called automatically by redirect(). Your redirect call seems suspect as well. I would just use $this- >redirect('/users/login'); Of course it is always

Re: calling exit() after redirect STILL redirects

2008-11-24 Thread David C. Zentgraf
On 25 Nov 2008, at 06:34, _Z wrote: > However when the form is submitted to login, they are instead > redirected back to the register view. That means your register form AND login action both work fine? Only after logging in the user goes back to the register view? By default the Auth compon

calling exit() after redirect STILL redirects

2008-11-24 Thread _Z
Hello, I am redirecting a user to a login page after they register for an account. A message is displayed to login with their new credentials. However when the form is submitted to login, they are instead redirected back to the register view. It would appear that code after the redirect() call i

Re: exit() after redirect

2006-09-23 Thread nate
Calling exit() is no better or worse than simply returning; it all depends on context. There is no one-size-fits-all solution to application security, outside of simply knowing your app and knowing what you're doing. And exit() is not a de-facto standard for anything. If it were, it would be in

Re: exit() after redirect

2006-09-22 Thread [EMAIL PROTECTED]
I was wondering when recommending exit() became the defacto standard. Thanks Samuel. MrRio, that is flawed. If you did a redirect() and then called return false the result to stop the current action, redirect them, and NOT delete the article is the same as exit() without the CakePHP breaking eff

Re: exit() after redirect

2006-09-22 Thread nate
Mika wrote: > This is exactly why I asked the question in the first place. > > I see that exit() seems to be recommended all over the place, but > people should realise that it will stop the flow of cake totally at > that spot. This is usually not a problem, as Nate said, but if you've > set some

Re: exit() after redirect

2006-09-22 Thread MrRio
I think the exit(); is very important and everyone should use it unless they know why they want code to execute afterwards. You can get nasty bugs, especially in authorisation, e.g. - Someone guesses the url: /articles/delete/3 - The auth component redirects the user to a login page. - And then t

Re: Re: exit() after redirect

2006-09-21 Thread Samuel DeVore
It's funny I the first time I remember seeing someone recomending this approach was in response to someone who wanted to know how to have cake stop doing anything after the redirect, and it soon became the standard way to tell people how to do it. Sam DOn 9/21/06, Mika <[EMAIL PROTECTED]> wrote: Th

Re: exit() after redirect

2006-09-21 Thread Mika
This is exactly why I asked the question in the first place. I see that exit() seems to be recommended all over the place, but people should realise that it will stop the flow of cake totally at that spot. This is usually not a problem, as Nate said, but if you've set some callbacks or something

Re: exit() after redirect

2006-09-21 Thread Chris Lamb
Lazy man's way of fixing the "redirect problem". Add: function redirect($url) { parent::redirect($url); exit(); } to your AppController. The problems associated with deviating from the default behaviour should be obvious, and it shouldn't really be too hard to search your code f

Re: exit() after redirect

2006-09-21 Thread [EMAIL PROTECTED]
That is what I am saying Nate. exit() does indeed break normal CakePHP functionality. Albeit you can break it if you want to. It is just that it indeed does. So, I am wondering why not ever time we see this instead recommend return false which gives the same result without breaking CakePHP. I

Re: exit() after redirect

2006-09-21 Thread nate
Well, of course the callbacks won't work, you're calling exit(). Nothing happens after an exit. It's not a matter of special cases: its too appication-specific for an exit() to be baked-in. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: exit() after redirect

2006-09-21 Thread Chris Hartjes
On 9/21/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > So it doesn't break anything except you said that the callbacks > wouldn't work. And then also what about if you wanted to redirect and > then after the redirect keep processing and actual delete the record > (or something similiar). >

Re: exit() after redirect

2006-09-21 Thread [EMAIL PROTECTED]
So it doesn't break anything except you said that the callbacks wouldn't work. And then also what about if you wanted to redirect and then after the redirect keep processing and actual delete the record (or something similiar). I am just against special case advising. Of course in egineering I

Re: exit() after redirect

2006-09-21 Thread yusuf
> Nope, calling exit() after a redirect doesn't break anything. The only > reason you wouldn't want to call it after a redirect is if you had some > other functionality that needed to be executed in a controller > callback, or if, for some reason, you really really wanted your view to > render.

Re: exit() after redirect

2006-09-21 Thread nate
Nope, calling exit() after a redirect doesn't break anything. The only reason you wouldn't want to call it after a redirect is if you had some other functionality that needed to be executed in a controller callback, or if, for some reason, you really really wanted your view to render. --~--~---

Re: exit() after redirect

2006-09-21 Thread [EMAIL PROTECTED]
Doesn't Cake do some cleanup after the function? What about after callbacks? Doesn't exit() break the Cake callback functionality? I think it is better to always use a return false; after redirect (or early render calls) so that you don't break CakePHP, add some functionality later and then won

Re: exit() after redirect

2006-09-21 Thread nate
In that case it doesn't really matter, since no code of any consequence is being executed in the action once you break out of the if block. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post t

Re: exit() after redirect

2006-09-21 Thread Chris Hartjes
On 9/21/06, Mika <[EMAIL PROTECTED]> wrote: > > Shouldn't people actually be calling return instead of exit? > Um, exit() makes sure your application stops, so I think that's probably what you're looking for after a redirect. -- Chris Hartjes "The greatest inefficiencies come from solving prob

Re: exit() after redirect

2006-09-21 Thread Mika
Shouldn't people actually be calling return instead of exit? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

exit() after redirect

2006-09-21 Thread yusuf
Hi, On this page: http://manual.cakephp.org/appendix/simple_user_auth in the example under "/app/controllers/users_controller.php (partial)" there is no exit() after the redirect in the "login" function. I have read on the web that you need to provide an exit() after the redirect, or addtional c