created session logic to sign in