Well there are several ways, continually updating a cookie with the lastvisited timestamp, or a much better way if you are using Sessions to count users online when deleting users from the table to update the users table with the last visited time. From here on its just basically getting that lastvisit time and finding newer posts which shouldnt be too hard.