Improve logging in from cookie