title: Lifecycle of a session cookie in an Android WebView / CookieSyncManager
body: <p>I have an Android application which makes requests to my webserver via both a WebView and an HttpClient. I sync cookies between the two using a CookieSyncManager. So far, so good. </p>
  
  <p>When my application starts (inside onResume()), I run a piece of logic similar to the following:</p>
  
  <pre><code>if ( appHasBeenIdleFor30Minutes() ) {
       CookieManager cookieManager = CookieManager.getInstance();
       cookieManager.removeSessionCookie();
       CookieSyncManager.getInstance().sync();
  }
  </code></pre>
  
  <p>This correctly resets any session cookies that were set from the user's previous session. My question is: <strong>will this behavior happen periodically on its own?</strong> This question (<a href="https://stackoverflow.com/questions/10006334/android-webview-or-browser-not-deleting-session-cookies-on-device-reboot">android webview or browser not deleting session cookies on device reboot</a>) seems to suggest that it does not. When I use the cookie-sync'd HttpClient via a Service it appears that session cookies are not cleared, thus resulting in strange server-side behavior.</p>
  
  <p>I've been unable to find concrete documentation on the lifecycle of session cookies (expiration time=0) inside a WebView/CookieSyncManager - has anyone else had more luck?</p>