add login function
add login status check and logout function