Implement make query and login logical

TODO:
 * parse query result
 * persistence login cookie
 * ....