Remember me implementation based on https://github.com/gbirke/rememberme