Refactoring ChatServer : Enable Cookies, use login page, correct socket errors