cookie will expire in a period which is specify in setcookie().
also you can save the REMOTE_ADDR to a file in your server, you can modify my code simply to achieve it.