i am trying to set a cookie as below.
CookieSyncManager.createInstance(context);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setCookie("http://wwww.mydomain.com",
"mycookie=123"; Domain=.mydomain");
CookieSyncManager.getInstance().sync();
When i access a page from mydomain.com, the cookie can be retrieved. but when i try to set cookie using IP address, the page cannot retrieve the cookie.
1) is it because we can only set cookie using hostname?
2) why when i access a website using IP address, the website is still able to set and retrieve the cookie?
Its a domain name by specification:
http://www.ietf.org/rfc/rfc2109.txt
Android might extract domain and path from an URL, but the domain must be a fully-qualified domain name.
Further, if you access via ip the following statement is relevant:
The answer is yes though.