summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/network/setrawcookie.js
diff options
context:
space:
mode:
authorMarvin Borner2018-11-07 22:10:16 +0100
committerMarvin Borner2018-11-07 22:10:17 +0100
commit954583f3d56fbfb60321725f13ad092e536e3737 (patch)
treea0505a763797582c61fd8c2f90b422456d8874c9 /node_modules/locutus/php/network/setrawcookie.js
parent1c355e6e956a4e507ed5436d0c814ba9c3a1deb2 (diff)
Removed node_modules
Diffstat (limited to 'node_modules/locutus/php/network/setrawcookie.js')
-rw-r--r--node_modules/locutus/php/network/setrawcookie.js50
1 files changed, 0 insertions, 50 deletions
diff --git a/node_modules/locutus/php/network/setrawcookie.js b/node_modules/locutus/php/network/setrawcookie.js
deleted file mode 100644
index 7ad21be..0000000
--- a/node_modules/locutus/php/network/setrawcookie.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-
-module.exports = function setrawcookie(name, value, expires, path, domain, secure) {
- // discuss at: http://locutus.io/php/setrawcookie/
- // original by: Brett Zamir (http://brett-zamir.me)
- // original by: setcookie
- // improved by: Kevin van Zonneveld (http://kvz.io)
- // input by: Michael
- // note 1: This function requires access to the `window` global and is Browser-only
- // bugfixed by: Brett Zamir (http://brett-zamir.me)
- // example 1: setrawcookie('author_name', 'Kevin van Zonneveld')
- // returns 1: true
-
- if (typeof window === 'undefined') {
- return true;
- }
-
- if (typeof expires === 'string' && /^\d+$/.test(expires)) {
- expires = parseInt(expires, 10);
- }
-
- if (expires instanceof Date) {
- expires = expires.toUTCString();
- } else if (typeof expires === 'number') {
- expires = new Date(expires * 1e3).toUTCString();
- }
-
- var r = [name + '=' + value];
- var i = '';
- var s = {
- expires: expires,
- path: path,
- domain: domain
- };
- for (i in s) {
- if (s.hasOwnProperty(i)) {
- // Exclude items on Object.prototype
- s[i] && r.push(i + '=' + s[i]);
- }
- }
-
- if (secure) {
- r.push('secure');
- }
-
- window.document.cookie = r.join(';');
-
- return true;
-};
-//# sourceMappingURL=setrawcookie.js.map \ No newline at end of file