accept global variable or cookie first

for Almond.js usage