Answer the question
In order to leave comments, you need to log in
Get cookies from response?
Hello. Can you please tell me how to get and save cookies when responding from the server with AJAX?
fetch( url )
.then( response => {
console.log(response.headers); // выводит пустой объект,
console.log(document.cookie) // Тут тоже пусто
Answer the question
In order to leave comments, you need to log in
The browser does this automatically, based on http headers. There is no need to do it with a script.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question