Fix some session related issues, add session support for mobile.