If you are using a database, you could setup a sort of tmp table,
where when someone logs in, it puts thier username or id into the tmp DB and thier $REMOTE_ADDR and $SID as well.
Then as part of the login script, check the tmp DB for that username/id and if $REMOTE_ADDR does not match, then kill $sid, remove first entry from tmp DB and replace with new login info.
I am sure there are better ways to do it, but I have not had my caffine yet, and this should at least get you on the right track.