Is there a way to set a cookie for 1 request?

I want a cookie (using JavaScript or jQuery) to be sent exactly once.

I can set a cookie with an expiration date by saying 1 second before making a request, but that seems a little gentle. I was wondering if there is a way to guarantee that the cookie is saved for 1 request, and only one request ...

I looked through the documents in MDN , but I don’t see anything that matches the invoice.

Any ideas?

+4
source share
1 answer

look here :)!
How to set / delete cookie using jQuery?

There is an answer in my eyes!

0
source

Source: https://habr.com/ru/post/1608785/


All Articles