Code for phonegap session