Hello! I have trouble passing the cookie into the WebView inject. I know how to inject the cookie. When the cookie is injected I want to display a member.php and this page requires a cookie. It shows me the error page even if I've injected the cookie.
The WebView are correctly loaded and I've tried to set a cookie using the CookieManager class. Alll this is known to me.
From the CookieStore I have tried to print out the whole cookie itself; which prints this:
[[version: 0][name:SQMSESSID][value: 9166729532c975f261bda9e6e583bdba]
[domain: mydomain.com][path: /][expiry: null], [version: 0][name: key]
[value: vrckNRab][domain: mydomain.com][path: /][expiry: null]]
Should be mentioned that the code above is the successful CookieStore when I have passed my correct username and password.
My inject + loadUrl code:
CookieStore cookie = /* CookieStore cookie takes a CookieStore from my
own function that succesful returns the CookieStore */
List<Cookie> listcookie = cookie.getCookies(); //Set my CookieStore to a list
Cookie setcookieOne = listcookie.get(0) //My cookie has two fields
Cookie setcookieTwo = listcookie.get(1) //....and assign these to a cookie
CookieManager cookieManager = CookieManager.getInstance();
CookieSyncManager.createInstance(getApplicationContext());
cookieManager.setAcceptCookie(true);
cookieManager.setCookie(setcookieOne.getDomain(), setcookieOne.getValue());
cookieManager.setCookie(setcookieTwo.getDomain(), setcookieTwo.getValue());
CookieSyncManager.getInstance().sync();
browse.setWebViewClient(new WebViewClient(){
});
browse.loadUrl("http://mypagethatwillredirectmeonacorrectcookie.php"); /* This
page will redirect if the cookie is successful */
Any ideas why it doesn't show the member.php?