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

Send cookies on requests to another domain #18

Closed
gualopezb opened this issue Aug 30, 2017 · 1 comment
Closed

Send cookies on requests to another domain #18

gualopezb opened this issue Aug 30, 2017 · 1 comment
Labels

Comments

@gualopezb
Copy link

I've been using the ahoy.js library to create ahoy events on a rails server on a different domain which has the ahoy gem configured. The events are being created successfully. However, I need to send the cookies on the request, because the server gets some extra data from that.
The above requires the following option to be set on the ajax request:

xhrFields: {
  withCredentials: true
}

Is there an option on ahoy.js to make this work?

I'm setting ahoy config in this way:

ahoy.configure({
  urlPrefix: 'http://otherdomain.com'
});
@gualopezb
Copy link
Author

@ankane This PR solves the issue: #19

The usage would be:

ahoy.configure({
  crossDomain: true
});

By default the crossDomain option is set to false.

@ankane ankane added the waiting label Feb 23, 2018
@ankane ankane closed this as completed Feb 18, 2019
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