WebView and Cookies on Android

Posted by dave smith on Stack Overflow See other posts from Stack Overflow or by dave smith
Published on 2010-04-02T11:55:07Z Indexed on 2010/04/02 12:03 UTC
Read the original article Hit count: 1346

Filed under:
|

I have an application on appspot that works fine through regular browser, however when used through Android WebView, it cannot set and read cookies. I am not trying to get cookies "outside" this web application BTW, once the URL is visited by WebView, all processing, ids, etc. can stay there, all I need is session management inside that application. First screen also loads fine, so I know WebView + server interactivity is not broken.

I looked at WebSettings class, there was no call like setEnableCookies.

I load url like this:

public class MyActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);       
    WebView webview = new WebView(this);
    setContentView(webview);      
    webview.loadUrl([MY URL]);
  }
  .. 
}

Any ideas?

© Stack Overflow or respective owner

Related posts about android

Related posts about java