update with log out function and customized phonegap plugin cookieManager