New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 690969 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jan 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug

Blocked on:
issue 679736



Sign in to add a comment

[Cronet] Cronet should comply with app's CookieAcceptPolicy instead of changing it.

Project Member Reported by mef@chromium.org, Feb 10 2017

Issue description

Recent refactoring of CookieStoreIOS ( issue 679736 ) has removed the method CookieStoreIOS::CreateCookieStore which was used in both CrNet and Cronet.

The removed method was setting [cookie_storage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; on the shared cookie storage, and its removal has broken cronet tests:

Thread 10 Crashed:: Chrome Network IO Thread
0   org.chromium.net.Cronet       	0x0000000106062c94 base::debug::BreakDebugger() + 20
1   org.chromium.net.Cronet       	0x00000001060cca61 logging::LogMessage::~LogMessage() + 4369
2   org.chromium.net.Cronet       	0x00000001060c9695 logging::LogMessage::~LogMessage() + 21
3   org.chromium.net.Cronet       	0x0000000105fdb072 net::CookieStoreIOS::SetCookieWithOptionsAsync(GURL const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, net::CookieOptions const&, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 690
4   org.chromium.net.Cronet       	0x0000000106eaab20 net::URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete(int) + 2128
5   org.chromium.net.Cronet       	0x0000000106ea984d net::URLRequestHttpJob::OnStartCompleted(int) + 2573
6   org.chromium.net.Cronet       	0x0000000106eb3847 void base::internal::FunctorTraits<void (net::URLRequestHttpJob::*)(int), void>::Invoke<net::URLRequestHttpJob*, int>(void (net::URLRequestHttpJob::*)(int), net::URLRequestHttpJob*&&, int&&) + 151
7   org.chromium.net.Cronet       	0x0000000106eb374f void base::internal::InvokeHelper<false, void>::MakeItSo<void (net::URLRequestHttpJob::* const&)(int), net::URLRequestHttpJob*, int>(void (net::URLRequestHttpJob::* const&&&)(int), net::URLRequestHttpJob*&&, int&&) + 95
8   org.chromium.net.Cronet       	0x0000000106eb36dd void base::internal::Invoker<base::internal::BindState<void (net::URLRequestHttpJob::*)(int), base::internal::UnretainedWrapper<net::URLRequestHttpJob> >, void (int)>::RunImpl<void (net::URLRequestHttpJob::* const&)(int), std::__1::tuple<base::internal::UnretainedWrapper<net::URLRequestHttpJob> > const&, 0ul>(void (net::URLRequestHttpJob::* const&&&)(int), std::__1::tuple<base::internal::UnretainedWrapper<net::URLRequestHttpJob> > const&&&, base::IndexSequence<0ul>, int&&) + 93
9   org.chromium.net.Cronet       	0x0000000106eb3624 base::internal::Invoker<base::internal::BindState<void (net::URLRequestHttpJob::*)(int), base::internal::UnretainedWrapper<net::URLRequestHttpJob> >, void (int)>::Run(base::internal::BindStateBase*, int&&) + 68
10  org.chromium.net.Cronet       	0x0000000105f9264a base::internal::RunMixin<base::Callback<void (int), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> >::Run(int) const + 74
11  org.chromium.net.Cronet       	0x00000001068543fa net::HttpCache::Transaction::DoLoop(int) + 5498

Ideally Cronet should NOT change Cookie Accept Policy set by the app, but instead comply with it, possibly by using different Cookie Store implementation.
 

 

Comment 1 by pkl@chromium.org, Feb 13 2017

Cc: mef@chromium.org
Owner: maksim.sisov@chromium.org
Status: Assigned (was: Untriaged)
Since maksim.sisov@ made the original change, I'm assigning this to maksim.
I believe https://codereview.chromium.org/2684933009/ should have already fixed the issue. mef@, can you confirm? 

Comment 3 by mef@chromium.org, Feb 14 2017

Cc: droger@chromium.org
Owner: mef@chromium.org
Corrrect, the original problem introduced in  issue 679736  is fixed by https://codereview.chromium.org/2684933009/  however it is unclear that current behavior (setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways) is always desired.

What if the application doesn't want to share its cookies with other apps on the system?
Doesn't it use https://cs.chromium.org/chromium/src/ios/net/cookies/cookie_store_ios_persistent.h then? If I am correct, CookieMonster is used as a backend and cookies are not synchronized with system cookies then.

Comment 5 by mef@chromium.org, Feb 16 2017

Currently there are no settings in Cronet API to let app choose between using cookie monster, system cookie store or keeping them in memory only.

Currently our networking stack relies on the following settings: 1) disable cache at HTTP level; 2) disable Cookies (i.e. HTTPShouldSetCookies = NO and HTTPCookieAcceptPolicy = NSHTTPCookieAcceptPolicyNever). could we add APIs to support these?
Status: Archived (was: Assigned)

Sign in to add a comment