Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created January 26, 2013 20:53
Show Gist options
  • Save jonleighton/4644544 to your computer and use it in GitHub Desktop.
Save jonleighton/4644544 to your computer and use it in GitHub Desktop.
page = require("webpage").create()
page.open("http://www.jonathanleighton.com", function() {
var date = new Date()
date.setTime(date.getTime() + 100000000)
date = date.toUTCString()
phantom.addCookie({
name: "omg",
value: "lol",
domain: "www.jonathanleighton.com",
expires: date
})
cookie = page.cookies[0]
for (var k in cookie) {
console.log(k + ": " + cookie[k])
}
phantom.exit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment