Set the cookie on login correctly