Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsubscribe event sends a synchronous http call for cross domains and no cookie and session information is present in this request #1315

Closed
Swaroop-Bhupathiraju opened this issue Sep 25, 2013 · 1 comment
Labels

Comments

@Swaroop-Bhupathiraju
Copy link

I use jsonp to do a cross domain call to the atmosphere server for normal http requests.
When the browser supports websockets, i use websocket communication but when a unsubscribe event happens, i think atmosphere sends the disconnect call (transport=close) as a regular http call to the server but not as a jsonp call.
In case of cross domain http requests, the session and cookie is not sent
JSONP might not be possible here as this will be a synchronous request

function disconnect() {
if (_request.enableProtocol && !_request.firstMessage) {
var query = "X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=" + _request.uuid;
var url = _request.url.replace(/([?&])=[^&]*/, query);
url = url + (url === _request.url ? (/\?/.test(_request.url) ? "&" : "?") + query : "");

                if (_request.connectTimeout > 0) {
                    jQuery.ajax({
                        url: url,
                        async: false,
                        timeout: _request.connectTimeout
                    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants