fix session bug, add Session class.