Added session and email sign-in logic