fix problem where session key is None