Fixing problems with session management on device