0

I created a LoginActivity which is connected to my REST API. I added there CookieHandler and CookieManager to use cookies in another activity. Everything works fine, I decided to remember user in SharedPreferences and I have a problem. The user is now redirecting directly to a new activity (which is OK), but this activity doesn't display anything because it needs to have cookies from LoginActivity. How can I solve this problem? I thought about adding cookies to SharedPreferenes but I don't know if it's a good way. Thanks in advance for a help!

Here is part of my LoginActivity:

val cookieManager = CookieManager()
CookieHandler.setDefault(cookieManager)
xaos_xv
  • 759
  • 1
  • 10
  • 27
  • Possible duplicate of [Pass cookies from HttpURLConnection (java.net.CookieManager) to WebView (android.webkit.CookieManager)](https://stackoverflow.com/questions/12731211/pass-cookies-from-httpurlconnection-java-net-cookiemanager-to-webview-android) – Reaz Murshed Apr 12 '18 at 18:57
  • You might also consider checking the link [here](https://medium.com/@elye.project/a-tale-on-android-cookies-store-management-b04832ca18c6) – Reaz Murshed Apr 12 '18 at 18:58

0 Answers0