Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

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
You can’t perform that action at this time.