Alpha Blue wrote:
> Can anyone provide me with a good article, screencast, or source on how
> to restrict multiple logins with rails?  I'm using Restful
> Authentication with Acts As State Machine and have my login system
> configured with observers, activation keys, etc.
> 
> I'm just trying to move forward a bit and restrict multiple logins.
> 
> Thanks..

Store the session cookie into the users table when a user logs in.
Set a before filter that checks the session key before serving any 
request. If it's different from the one in the users table, redirect the 
user to the login page.

When a user logs in with an account another user logged in with the same 
account will be required to log in. If two users keep trying to access 
the service with the same account they'll end up logging out each other. 
However if a legitimate user tries to access your service with two 
browsers at the same time, s/he'll may end up a little upset.

Paolo
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to