implement sessionCheck and fix client session bug.