EventSource.withCredentials

The withCredentials read-only property of the EventSource interface returns a Boolean indicating whether the EventSource object was instantiated with CORS credentials set.

Syntax

var myWithCredentials = eventSource.withCredentials;

Value

A Boolean indicating whether the EventSource object was instantiated with CORS credentials set (true), or not (false, the default).

Examples

var evtSource = new EventSource('sse.php');
console.log(evtSource.withCredentials);

Note: You can find a full example on GitHub ā€” see Simple SSE demo using PHP.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'withCredentials' in that specification.
Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
withCredentialsChrome Full support 6Edge No support NoFirefox Full support 6IE No support NoOpera Full support YesSafari Full support 5WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 45Opera Android Full support 12Safari iOS Full support 5Samsung Internet Android ?

Legend

Full support Ā 
Full support
No support Ā 
No support
Compatibility unknown Ā 
Compatibility unknown

See also