[OE-2925] Fixed session flag handling