Building login function and cool session.