when you "login" create a session with a random key..
store that key in with the users ID in a sessions table (mysql) the script then checks if your logged inn (matched the session key to the one in the database).
now
User A logs in, session key (AAAFF) is created and a session for UserID , now in the sessions database user ID A doesn't exist so it creates one (stores USER ID & SESSION KEY).
now as the user uses the system the system will check if the sessions match the ones in the database.
ok
Now he logs in again
session key (BBBFF) is created and a session for UserID , now in the sessions database user ID A does exist so it updates the session key.
now that account will work but the first login will never match as it now has a new session key..