We used to have a lot of duplicate code to handle large session data that was buggy, this commit refactor it various server/pkg packages