How to use 'document write document cookie' in JavaScript

Every line of 'document write document cookie' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
48function setCookieForDocument(doc, name, value, expire) {
49 logger.write(logger.INTERNAL,"cookies.js setCookieForDocument("+doc+","+name+","+value+","+expire+")");
50 doc.cookie = name + "=" + escape(value)
51 + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))

Related snippets