Fix login and logout for cordova phonegap.