It does not work still i tried
$this->redirect(array('action'=>'login'), null, true);
it was working on my old server but did not work on new server
On Monday, January 7, 2008 8:32:46 PM UTC+5:30, Adam Royle wrote:
>
> It does work as you would expect - but you're obviously experiencing
> issues. Try this.
>
> function foo()
> {
> $this->Session->setFlash("Hello world");
> $this->redirect('/', null, true);
> }
>
> On Jan 7, 11:57 pm, Ben Coleman <[email protected]> wrote:
> > Hi,
> >
> > I'm trying to use the session flash message with controller actions
> > that redirect - with no luck.
> > For example, if I have the following action defined in a controller
> > called test:
> > function foo()
> > {
> > $this->Session->setFlash("Hello world");
> > $this->redirect('/');
> > }
> > This is redirecting back to my homepage (which via the default routing
> > goes to pages/home) if try to display the flash in the view app\views
> > \pages\home.thtml view it never appears (I'm using "$session->flash()".
> However if remove the redirect and let the action render
> >
> > it's view (app\views\test\foo.html) the flash message will appear OK
> > in this view.
> >
> > What is wrong? The redirect seems to be consuming the flash message.
> > This seems a big problem if you can't use the session flash with
> > redirects; as I'd like to pass messages back to the user from viewless
> > actions (such as delete)
--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en.