Hi, I have one site having a login feature ,what i want is that if a user is logged in to his account from one computer ,and then again if he logs into his same account at the same time from another computer he should be logged out of the computer which he logged in in the first instance .Any idea how to implement it will be great .
You need to store your session in a database. There you can have a table containing session(session_id, username, session_data). session_id and session_data are self explaining. You use the "username" field to store the name of the logged in user. If the user logs in again from a different computer you can easily query that table and remove the duplicate session.
There are lots of implementations for database backed session handling in PHP available on the net.
Assuming you're using cookie-based sessions, your best bet is probably to keep track of the last active session ID per user. This way, when the user logs in from a different computer, the last active session ID gets updated, and when (s)he tries to continue on the previous session, you can catch this and end the old session.