Fixed a bug with session rotation.