Refactor Web and Flash Socket sessions classes