I want to retrieve all cookies in a browser using java (i.e. request.getCookies()).
The problem is request.getCookies() retrieves cookies of fb.com and if I want to get cookies of ‘abc.fb.com’ it is showing only cookies of ‘fb.com’ and not ‘abc.fb.com’.
How to overcome this?
As mentioned it’s not allowed due to the same origin policy.
But you will be able to get both cookies only if you store them for the domain “fb.com”. In that case you will get the same set of cookies in requests to fb.com and abc.fb.com as well.