Fetch: Use of default cookie manager

Created on 19 Dec 2018  路  6Comments  路  Source: tonyofrancis/Fetch

@tonyofrancis What is the actual use & need of the default cookie manager in v2.3.4?
What is the different between use that and add cookies using addHeader() method?

Related to #281, #300

question

All 6 comments

The cookie manager will automatically manage the cookie on the http client for specific websites/links that needs cookies. Some links need a cookie manager enabled to allow downloading. Just like a website may need cookies enabled to work correctly.

I always use addHeader() method to add cookies,
So now the question is "Is that necessary now? Because you introduce default cookie manager..",
Then what should be the correct fetch configuration for android.

BTW it would be great, if you automate these type (manually add cookies) of boilerplate.

I always use addHeader() method to add cookies,
So now the question is "Is that necessary now? Because you introduce default cookie manager..",
Then what should be the correct fetch configuration for android.

BTW it would be great, if you automate these type (manually add cookies) of boilerplate.

Hey jpvs0101, can you give an example of how to add cookie to request? I am trying but no success.

I always use addHeader() method to add cookies,
So now the question is "Is that necessary now? Because you introduce default cookie manager..",
Then what should be the correct fetch configuration for android.
BTW it would be great, if you automate these type (manually add cookies) of boilerplate.

Hey jpvs0101, can you give an example of how to add cookie to request? I am trying but no success.

Its simple, request.addHeader("Cookie", yourCookieString);
"Cookie" - is a header keyword;

Thanks! I figured it out yesterday. :)

I always use addHeader() method to add cookies,
So now the question is "Is that necessary now? Because you introduce default cookie manager..",
Then what should be the correct fetch configuration for android.

BTW it would be great, if you automate these type (manually add cookies) of boilerplate.

@jpvs0101 adding a cookie header to requests causes no issues. Some websites/servers require specific cookies that you may have to provide that the cookie manager by default cannot.

Was this page helpful?
0 / 5 - 0 ratings