Added a sanity check to session management. Relevant when a user adds an iframe app, then removes it.