Just one session for one user

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. Thanks.

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