This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25800 - Impossible to create Sync XHR request with withCredentials = true
Summary: Impossible to create Sync XHR request with withCredentials = true
Status: RESOLVED INVALID
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 major
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 09:01 UTC by Narendra Sisodiya
Modified: 2014-05-19 10:09 UTC (History)
2 users (show)

See Also:


Attachments

Description Narendra Sisodiya 2014-05-19 09:01:29 UTC
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-withcredentials-attribute

This spec says 
When set: throws an "InvalidAccessError" exception if the synchronous flag is set and we want to set withCredentials attribute.

That means, It is impossible to create Cross-Domain Synchronoue XHR requests when we want to set withcredentials = true.

Please remove this condition as this is not needed.
Comment 1 Anne 2014-05-19 09:02:39 UTC
It is. Synchronous fetching is bad for end users.
Comment 2 Narendra Sisodiya 2014-05-19 09:20:20 UTC
@Anne  - Yes, It is very very bad thing, but We should not BAN somebody who want to do such thing.
I have a situation where template rendering service need some data from server which I have to fetch in Sync way.
So, I got banned from craeting a sync-post-cross-domain xhr call.
Instead of throwing error , you might put a console warning.

Let me know if I am wrong at any point.
Comment 3 Anne 2014-05-19 09:37:23 UTC
You need to restructure your code to not require that to be synchronous. We should ban it, because it creates a bad user experience.
Comment 4 Narendra Sisodiya 2014-05-19 10:06:50 UTC
@Anne - If this is your take then just BAN synchronous concept from the whole spec itself.
        We do not need synchronous-flag at all.
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#synchronous-flag
Comment 5 Anne 2014-05-19 10:09:49 UTC
Per http://xhr.spec.whatwg.org/#the-open%28%29-method it is more or less banned. See the huge warning.