[PHP/MySQL] Keeping track of sign in

What’s the best way to keep track of whether or not a user is signed in?

[LIST=1]
[]Cookies
[
]Session ID’s
[*]Make an active users table in a MySQL table. Delete entries from this table if user signs out.
[/LIST]

With option 3, after you enter someone into the signed-on table, how do you check that they are signed on when they visit different pages? Like how do you connect a person with that entry?