T
T
tincap2018-01-13 11:09:18
JavaScript
tincap, 2018-01-13 11:09:18

Is there a way to pass data using JS with cookies?

The other day I started to study XMLHttpRequest and came to the conclusion that cross-domain requests using cookies are impossible.
This is the code that won't work. XMLHttpRequest is not designed to work with Cookies

var xhr = new XMLHttpRequest;
xhr.withCredentials = true;
xhr.setRequestHeader('Cookie', 'x=x');

But what if I want to send cookie data in the header to a foreign server?
Important note: I'm creating a browser extension, so by default allow-control-allow-origin is: *

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
frees2, 2018-01-13
@frees2

Actually, yes (but only disguise and connection with the script), and then read them, including from other sites where the script is installed (part of the script in js), spy, study statistics and user preferences.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question