session encrypted flag bug