Clean up the session stack before appjs.js loaded.