You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/08/29 09:14:56 UTC

[GitHub] [cordova-android] smalluban commented on issue #802: Cookies not stored on first application launch

smalluban commented on issue #802: Cookies not stored on first application launch
URL: https://github.com/apache/cordova-android/issues/802#issuecomment-526100035
 
 
   @th3hamm0r We've got the same issue in our application. After the investigation, I think there might not be a simple solution on `cordova-android` side, as from API 21 sync between WebView and CookieManager is done automatically - and I believe that this is a reason for 30 seconds delay. It simply has to have a 30-second timer :P 
   
   However, I have found Cordova plugin (https://github.com/apache/cordova-android/issues/802#issuecomment-519673201), which exposes the `flush` method from the CookieManager. If you call that method after your request with `set-cookie`, it will immediately save cookies to persist storage. The original source of the plugin does not include `package.json` file, so be welcome to use our fork: https://github.com/surgeventures/cordova-plugin-cookie-manager
   
   In our code immediately after login/logout action we call for andriod:
   
   ```javascript
   window.cordova.plugins.CookieManagementPlugin.flush();
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org