Skip to content

Instantly share code, notes, and snippets.

@adriancooney
Created July 23, 2015 17:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adriancooney/bfde1565d7639961193d to your computer and use it in GitHub Desktop.
Save adriancooney/bfde1565d7639961193d to your computer and use it in GitHub Desktop.
Quick snippet to display cookie in NW.js (node-webkit) in a sweet console table.
require("nw.gui").Window.get().cookies.getAll({}, console.table.bind(console));
@aashish
Copy link

aashish commented Jan 8, 2016

The snippet was helpful.
setting a cookie is not working. Can you help.

var gui = require('nw.gui');
gui.Window.get().cookies.set({
      url: 'www.test.com',
      name: 'lang',
      domain: 'test.com',
      path: '/',
      secure: false,
      httpOnly: false,
      value: 'test' ,
      expirationDate: (new Date().getTime()/1000) + (365 * 24 * 3600)
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment