0

i have an android app with a webView to open some youtube links but i have a problem that every time the app close and reopen i need to login again i read some questions here but didn't got an answer this is my code.

webView = findViewById(R.id.webView);
    String url = "https://www.youtube.com/watch?v="+vidInfo[vidNum][2];
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webSettings.setDomStorageEnabled(true);
    webSettings.setAppCachePath(getCacheDir().getPath());
    webSettings.setAppCacheEnabled(true);
    webSettings.setMediaPlaybackRequiresUserGesture(true);
    webView.setWebViewClient(new WebViewClient());
    webView.loadUrl(url);
Raghed Kahil
  • 33
  • 1
  • 4

1 Answers1

1

your session data is saved in cookies. you therefore need to make them persistent between sessions checkout this answer

denniz crypto
  • 451
  • 4
  • 10