in Codeigniter I am building an Authentication system for my web site and to achieve that I use session library
session->set_userdata(\'username\')
<
You could use isset to check if the cookie has a value, and if the cookie is deleted, it will return negative. If it is negative, you can set the cookie again... of course, this will be like "renewing" the cookie, so if the user doesn't come by the expiration, they will be forgotten. (Set a very big time till the expiration!)
For example: