how about something like this?
auth.messages.logged_in=T('Hello %(first_name)s and welcome on the
'+appTitle')
def index():
"""
Index page
"""
session.counter = (session.counter or 0) + 1
if auth.user and auth.user.first_name!=0 and session.counter<=0:
pass
elif session.counter>0:
pass
else:
if not response.flash: response.flash = T('Hello')
return dict(message=T(''))
On Nov 24, 10:05 am, Richard Vézina <[email protected]>
wrote:
> Hello
>
> I need to have a response.flash on index page at login but not when the user
> come back on index page during a session. I try to user session.counter but
> the session is not reset until the cookies are erase I think.
>
> Here my index controller (*not working*) :
>
> def index():
> """
> Index page
> """
> session.counter = (session.counter or 0) + 1
> if auth.user and auth.user.first_name!=0 and session.counter<=0:
> response.flash = DIV(T('Hello ')+str(auth.user and
> auth.user.first_name),BR(),T('Welcome on the '),appTitle)
> elif session.counter>0:
> pass
> else:
> response.flash = T('Hello')
> return dict(message=T(''))
>
> Richard