[Catalyst] Root.pm $c->detach() does not detach?

Michael Reece mreece at vinq.com
Tue Apr 3 17:33:18 GMT 2007


On Apr 3, 2007, at 9:18 AM, Luis Azevedo wrote:

> Hi All,
>
> In Root.pm, "auto" action I am trying to break the execution of  
> chain of
> Actions.
>
> To be more exact, whenever I detect I loose connection to a socket  
> or cookie
> session, I want to redirect the user to a login action, not  
> rendering the
> action the user is calling.
>
> I know I can make a simple $c->res->redirect() but the problem is I  
> need to
> show a message in the login page telling the reason for the  
> "logout". Usually
> I am passing messages trough Stash. Redirecting to the Login page  
> needs to
> pass message somehow (through GET or POST, therefore not so  
> beautiful s).
>

see $c->flash method in perldoc Catalyst::Plugin::Session --
"Think of it as a stash that lasts for longer than one request,  
letting you redirect instead of forward."


> I have tried to detach the /login action,  in "auto" action from  
> Root.pm
> controller,  but it is not working and I don't know why. See the  
> actions
> chain:
> | /auto
> |  -> /login/index
> | /about/index
> | /end
>
> The user called the /about action.
>
> Can I break the chain somehow in Root.pm, "auto" action?

have you tried avoiding detach and using { $c->forward('/login/ 
index'); return 0; } ?





More information about the Catalyst mailing list