Skip to content

Commit

Permalink
Add 'nocookie' flag if we couldn't set cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Apr 4, 2018
1 parent eacde8c commit 94cfa61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion boomerang.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ BOOMR_check_doc_domain();

if (!name || !impl.site_domain) {
BOOMR.debug("No cookie name or site domain: " + name + "/" + impl.site_domain);
return false;

BOOMR.addVar("nocookie", 1);
return null;
}

value = this.objectToString(subcookies, "&");
Expand All @@ -566,6 +568,7 @@ BOOMR_check_doc_domain();
BOOMR.warn("Cookie too long: " + nameval.length + " " + nameval);
}

BOOMR.addVar("nocookie", 1);
return false;
},

Expand Down
4 changes: 4 additions & 0 deletions tests/page-templates/00-basic/00-onload.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ describe("e2e/00-basic/00-onload", function() {
it("Should have set Page ID (pid)", function() {
assert.isString(tf.lastBeacon().pid, "pid");
});

it("Should have set nocookie=1", function() {
assert.equal(tf.lastBeacon().nocookie, "1");
});
});

0 comments on commit 94cfa61

Please sign in to comment.