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)