On Jan 8, 2008, at 10:28 AM, Vapor .. wrote:
> I want one user to have one session only. If user signs in again on  
> some
> other station, it should automatically log off from previous session.
> I really dont know how to implement this.
> Somebody please guide me. I am storing my session in DB.
You want to delete the rest of sessions for that user, but in a  
regular setup of the AR session store the user_id associated to a  
record is marshalled as session data.
You''d need to add a custom column user_id in the sessions table and  
maintain that column somehow, for example in an after_filter in  
ApplicationController. This solution is explained in The Rails Way.
-- fxn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---