move session headers init to a method
move long string to static var
add login method and some Exception
add some DEFAULT and add check_login method