-
-
Save erickzhao/d8ae35040d44d426cb40d97d5d77a47e to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Empty --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { app, session } = require('electron'); | |
async function testCookies() { | |
const name = 'foo' | |
const url = "/" | |
const cookies = session.defaultSession.cookies | |
const cookie = { | |
url, | |
name, | |
value: 'Hello World!', | |
expirationDate: 99999999999999999999 | |
} | |
await cookies.set(cookie) | |
// Query all cookies. | |
const addedRes = await cookies.get({}) | |
console.log("Added", addedRes) | |
await cookies.remove(url, name) | |
const removedRes = await cookies.get({}) | |
console.log("Removed", removedRes) | |
} | |
//.... | |
app.on('ready', () => { | |
testCookies() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment