In django, they use a messaging system based in the database, and
relate messages from the user with his session. When the message is
fetched to the user, it is then removed immediatly. That makes it
possible for redirects to show messages for an user after a redirect,
tought it does not work for non-authenticated users. Maybe if you
could relate messages in the database to the user ip if he is not
logged, and to his session, if he is logged...that could do the
trick.

For what i understand, you can't flash messages to an user after a
redirect because the flash message get's stored in the response for
the original request. After a redirect, a new request is made, and a
new response is created, so, the application has no way to remember
that a flash message was generated.

Another way to store "flash" messages could be storing them in a
cookie before the redirect, and erase them after reading them.
Probably not a safe choice for some systems, and if cookies is turned
off in the browser, the messages would get lost.

There's one more way that i can think of. You could, in the redirect,
specify a GET parameter like: &message_status=1. That could do the
trick, nice and dirty, tough you would have to filter messages
depending on user previlegies or something.

On 15 abr, 21:07, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Because I cannot find a way to make it work. I do not believe it is
> possible. I may be wrong and if you find a way send me a patch.
>
> Massimo
>
> On Apr 15, 6:38 pm, ceej <cjlaz...@googlemail.com> wrote:
>
> > Is there a reason response.flash doesn't work with redirect('/') ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to