Fix session issue in mdm app