some session handling improvements