Problem with setFlash

View: New views
6 Messages — Rating Filter:   Alert me  

Problem with setFlash

by angel333 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

I have a problem with SessionComponent::setFlash(). When I save
something in flash, it should be shown on next page and it should
expire when user go to another page. But it doesn't expire
immediatelly, but after a long while (probably session expiration).
When I turn cookies off, it seems to work.

I have tried writing $session->flash() in view (layout) twice. As I
expected, the first flash() deleted Message.flash, so the second
didn't flash. But on next request it flashes the same message again.

Finally, I'm sorry for my English :).

Thanks, Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with setFlash

by the_woodsman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This sounds like caching to me.
What debug level are you on?
Do you use view caching?
What browser do you use?
etc!

On Jul 6, 7:35 am, angel333 <ondrejsi...@...> wrote:

> Hello,
>
> I have a problem with SessionComponent::setFlash(). When I save
> something in flash, it should be shown on next page and it should
> expire when user go to another page. But it doesn't expire
> immediatelly, but after a long while (probably session expiration).
> When I turn cookies off, it seems to work.
>
> I have tried writing $session->flash() in view (layout) twice. As I
> expected, the first flash() deleted Message.flash, so the second
> didn't flash. But on next request it flashes the same message again.
>
> Finally, I'm sorry for my English :).
>
> Thanks, Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with setFlash

by angel333 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you for your reply.

No, I don't use view caching.
I am on debug 1, but I've tried debug 0 with the same result.
I'm using both Opera and Firefox.

Ondrej

On Jul 7, 1:10 am, the_woodsman <elwood.ca...@...> wrote:

> This sounds like caching to me.
> What debug level are you on?
> Do you use view caching?
> What browser do you use?
> etc!
>
> On Jul 6, 7:35 am, angel333 <ondrejsi...@...> wrote:
>
>
>
> > Hello,
>
> > I have a problem with SessionComponent::setFlash(). When I save
> > something in flash, it should be shown on next page and it should
> > expire when user go to another page. But it doesn't expire
> > immediatelly, but after a long while (probably session expiration).
> > When I turn cookies off, it seems to work.
>
> > I have tried writing $session->flash() in view (layout) twice. As I
> > expected, the first flash() deleted Message.flash, so the second
> > didn't flash. But on next request it flashes the same message again.
>
> > Finally, I'm sorry for my English :).
>
> > Thanks, Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with setFlash

by francky06l :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Seems you are always setting the flash message somehow .. Try to trace
in log before you use $this->Session->setFlash, maybe it's done when
you think it's not...

On Jul 7, 1:44 pm, angel333 <ondrejsi...@...> wrote:

> Thank you for your reply.
>
> No, I don't use view caching.
> I am on debug 1, but I've tried debug 0 with the same result.
> I'm using both Opera and Firefox.
>
> Ondrej
>
> On Jul 7, 1:10 am, the_woodsman <elwood.ca...@...> wrote:
>
> > This sounds like caching to me.
> > What debug level are you on?
> > Do you use view caching?
> > What browser do you use?
> > etc!
>
> > On Jul 6, 7:35 am, angel333 <ondrejsi...@...> wrote:
>
> > > Hello,
>
> > > I have a problem with SessionComponent::setFlash(). When I save
> > > something in flash, it should be shown on next page and it should
> > > expire when user go to another page. But it doesn't expire
> > > immediatelly, but after a long while (probably session expiration).
> > > When I turn cookies off, it seems to work.
>
> > > I have tried writing $session->flash() in view (layout) twice. As I
> > > expected, the first flash() deleted Message.flash, so the second
> > > didn't flash. But on next request it flashes the same message again.
>
> > > Finally, I'm sorry for my English :).
>
> > > Thanks, Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with setFlash

by angel333 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

Which log do you mean? I have only errors.log and debug.log, but there
are no messages about this.

On Jul 7, 5:05 am, francky06l <franckl...@...> wrote:

> Seems you are always setting the flash message somehow .. Try to trace
> in log before you use $this->Session->setFlash, maybe it's done when
> you think it's not...
>
> On Jul 7, 1:44 pm, angel333 <ondrejsi...@...> wrote:
>
>
>
> > Thank you for your reply.
>
> > No, I don't use view caching.
> > I am on debug 1, but I've tried debug 0 with the same result.
> > I'm using both Opera and Firefox.
>
> > Ondrej
>
> > On Jul 7, 1:10 am, the_woodsman <elwood.ca...@...> wrote:
>
> > > This sounds like caching to me.
> > > What debug level are you on?
> > > Do you use view caching?
> > > What browser do you use?
> > > etc!
>
> > > On Jul 6, 7:35 am, angel333 <ondrejsi...@...> wrote:
>
> > > > Hello,
>
> > > > I have a problem with SessionComponent::setFlash(). When I save
> > > > something in flash, it should be shown on next page and it should
> > > > expire when user go to another page. But it doesn't expire
> > > > immediatelly, but after a long while (probably session expiration).
> > > > When I turn cookies off, it seems to work.
>
> > > > I have tried writing $session->flash() in view (layout) twice. As I
> > > > expected, the first flash() deleted Message.flash, so the second
> > > > didn't flash. But on next request it flashes the same message again.
>
> > > > Finally, I'm sorry for my English :).
>
> > > > Thanks, Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problem with setFlash

by angel333 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Solved. It's because of using requireAction() in my layouts and
helpers.

Ondrej

On Jul 5, 11:35 pm, angel333 <ondrejsi...@...> wrote:

> Hello,
>
> I have a problem with SessionComponent::setFlash(). When I save
> something in flash, it should be shown on next page and it should
> expire when user go to another page. But it doesn't expire
> immediatelly, but after a long while (probably session expiration).
> When I turn cookies off, it seems to work.
>
> I have tried writing $session->flash() in view (layout) twice. As I
> expected, the first flash() deleted Message.flash, so the second
> didn't flash. But on next request it flashes the same message again.
>
> Finally, I'm sorry for my English :).
>
> Thanks, Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price