I would think that you would have a field in your table if you table was called user have a field in there that is called say remember
now on your sign in form you have your checkbox so when you hit submit it will then check if the user is valid if so then it adds a random code in to the field remember
on your pages that are for login user you would want to check first if a sesson isset if set then user is log in and if not then check if cookie (remember_yoursite) exist if exist then look in the database to see who that cookie belongs to and then it sets the user session, if there is no cookie then no user logged in
now this cookie should expire so now once it expire and the person logs in again it updates the fiield in the table user, if the person sign in and does not have the remember me box checked then it will delete the cookie
ADD:
Also if the person thats using your site uses the log out link then the cookie should be deleted and also in the field of the table should be emptyed
now I could not help with coding on this and if you success with this please post the code as I would love to make this happen on my site also.
Hope this helps you!
Sincerely,
Christopher