refine server side,add session, adjust register/login method