# Flash Messages based on login session?

**URL:** <https://www.ruby-forum.com/t/flash-messages-based-on-login-session/176639>\
**Category:** Rails\
**Created:** [October 3, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/flash-messages-based-on-login-session/176639 "2009-10-03T19:14:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [October 3, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/flash-messages-based-on-login-session/176639/1 "2009-10-03T19:14:04Z")

</div>

Hi guys,

I’m not sure how to start doing this, and I really hope I don’t sound  
very  
vague.

Is there any function/helper that can be used to send a string  
containing a  
message to a user to display upon his (gender neutral) next login? I’m  
currently using AuthLogic, and I’m not sure if there’s any other way to  
do  
this other than storing that message into the database and then  
retrieving  
it. (since its only gonna be displayed once).

I think the closest way for me to describe it, is like a flash message  
but  
for next login.

Thanks again.

Warmest regards,  
David

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [October 3, 2009, 7:59pm UTC](https://www.ruby-forum.com/t/flash-messages-based-on-login-session/176639/2 "2009-10-03T19:59:08Z")

</div>

I’m not aware of any features that would do that automatically. I would  
think your best bet would be to just store those messages for next time  
in  
the database.

Hope that helps,  
Jim  
[http://www.thepeoplesfeed.com/](http://www.thepeoplesfeed.com/)

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [October 3, 2009, 9:37pm UTC](https://www.ruby-forum.com/t/flash-messages-based-on-login-session/176639/3 "2009-10-03T21:37:28Z")

</div>

2009/10/3 David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I think the closest way for me to describe it, is like a flash message but  
> for next login.

You are going to have to store it somewhere, assuming that you cannot  
determine it in some other way at the next login. The db seems like  
the obvious place. Presumably in the user table if it is on a per  
user basis. Alternatively, if it is an usual situation you could have  
a messages table where Message belongs\_to user, or has\_many users if  
the same message goes to a number of users.

Colin
