title: Android WebView- remember username and password
body: <p>I am making a basic WebView app that will load a web page.  This web page requires log in information.  When I navigate out or refresh the page it logs me out.  How do I stay logged in? The following code is my attempt based on some research but apparently I am not understanding the concept. And so I can kill two bird with one stone, can someone let me know how to prevent a refresh of the page when you rotate your phone? is this possible?  Thanks for any help in advanced.  </p>
  
  <pre><code>    public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
  
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.loadUrl("www.randomurl.com");
    mWebView.setWebViewClient(new HelloWebViewClient());
    CookieSyncManager.createInstance(this);
    CookieSyncManager.getInstance().startSync();
    CookieManager.getInstance();
   }
  </code></pre>