The set() method of the CookieStore interface sets a cookie with the given name and value or options object.
set()
MDN Reference