1

i have in my app two activities, and in each activity i have a web view. if i created a session in my php code in the first webview, can i read this session in the 2nd webview??

and what is the cookiemanager used for? is it for reading the sessions created over the server (by php) or there is a session created over the app?

the same question is asked here: android - share session between two webviews? but i didn't get the exact answer!! Thanks

Community
  • 1
  • 1
user1386213
  • 951
  • 9
  • 17

1 Answers1

0

There is only ONE instance of the CookieManager per application, so by default, if you log into a website in one activity and then go to another activity without logging out, you should be logged in if going to that website in the second activity. Actually, I've found it basically impossible to not be logged in the second activity due due to there only being one CookieManager instance, without clearing the cookies or disabling cookies...

Cookies in the CookieManager basically handle themselves, although you can get and remove cookies from the database for a particular website.

anthonycr
  • 4,146
  • 1
  • 28
  • 35