I'm guessing that you use a database for your users. You could create a table with two fields
user_id
message_id
When a user logs in, display message #x to user #y and create a record in this table ONLY IF there is no such record currently in the table.