Bug 186617 - Safari on iOS 11.4 not sending cookies on POST requests
Summary: Safari on iOS 11.4 not sending cookies on POST requests
Status: RESOLVED DUPLICATE of bug 186205
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 11
Hardware: iPhone / iPad iOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-14 01:02 PDT by N
Modified: 2018-10-02 18:40 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description N 2018-06-14 01:02:20 PDT
I've been using the same code for years and things have been working very well on every browser so far:

$.ajax({
    url: '/test.php',
    data: parameters,
    dataType: 'html',
    type: 'post'
})

However, since my users started to upgrade to iOS 11.4, those who use the Private mode of Safari are having an issue with "being disconnected" from my website.

This is because ajax POST requests aren't sending any Cookies, apparently. A whole new session is created as part of that POST request (new cookies created, etc).

However, that doesn't affect anything on the GET requests themselves. They stay with the same cookies (and therefore same session), even though new cookies were set as part of the ajax POST request. It's like those ajax POST requests are "sandboxed", not affecting anything else.

Any ideas? Is this a bug on Safari on iOS 11.4 ?
Comment 1 Radar WebKit Bug Importer 2018-06-14 03:46:05 PDT
<rdar://problem/41120766>
Comment 2 N 2018-06-14 11:19:13 PDT
It somehow seems to send consistently DIFFERENT cookies.

They are related to my website, e.g. same Session Cookie name, but with a completely different Session ID in the value.

It doesn't send other cookies that would normally be sent in that POST request, though... (but on Normal (non-Private) mode they are sent, correctly)
Comment 3 Chris Dumez 2018-06-14 11:32:21 PDT
Are you using service workers? We had a regression in iOS 11.4 related to service workers, cookies and private session. The bug was fixed recently but has not shipped yet.
Comment 4 Chris Dumez 2018-06-14 11:41:26 PDT
(In reply to Chris Dumez from comment #3)
> Are you using service workers? We had a regression in iOS 11.4 related to
> service workers, cookies and private session. The bug was fixed recently but
> has not shipped yet.

If service workers are involved, this is very likely a dupe of Bug 186205.
Comment 5 N 2018-06-14 11:52:03 PDT
I use service workers, yes. When will this be shipped?
Comment 6 Chris Dumez 2018-06-14 11:56:10 PDT
Unfortunately, Apple does not comment about when a particular fix will ship to customers. I cannot say anything until it ships in a beta.

If you have a test page, I'd be happy to confirm my fix works for that test page as well.

*** This bug has been marked as a duplicate of bug 186205 ***
Comment 7 Alexey Proskuryakov 2018-06-14 23:45:09 PDT
(also, the fix will presumably be in the next Safari Tech Preview to verify)
Comment 8 Chris Dumez 2018-06-15 07:00:57 PDT
(In reply to Alexey Proskuryakov from comment #7)
> (also, the fix will presumably be in the next Safari Tech Preview to verify)

The bug was reported on iOS...
Comment 9 shalin_i_parmar 2018-10-02 18:40:49 PDT
I still see that this issue is happening for all Safari browsers and it is not consistent, i.e. it send with most of GET requests but not all.

In two of our apps, we see that the request was not being sent with cookies at all for variety of requests including GET and POST.

Please fix this as it is very annoying and hard to detect.