add login function,register function and session support