diff --git a/app/filtering.js b/app/filtering.js index cb75cdbc2ba..28214e8b411 100644 --- a/app/filtering.js +++ b/app/filtering.js @@ -693,14 +693,3 @@ module.exports.clearAutofillData = () => { ses.autofill.clearAutofillData() } } - -module.exports.setCookie = (cookie) => { - for (let partition in registeredSessions) { - let ses = registeredSessions[partition] - ses.cookies.set(cookie, (error) => { - if (error) { - console.error(error) - } - }) - } -} diff --git a/app/importer.js b/app/importer.js index 6a5ced85637..a28dbf3e887 100644 --- a/app/importer.js +++ b/app/importer.js @@ -8,6 +8,7 @@ const electron = require('electron') const importer = electron.importer const dialog = electron.dialog const BrowserWindow = electron.BrowserWindow +const session = electron.session const Immutable = require('immutable') const showImportWarning = require('./aboutDialog').showImportWarning const siteUtil = require('../js/state/siteUtil') @@ -15,7 +16,6 @@ const AppStore = require('../js/stores/appStore') const siteTags = require('../js/constants/siteTags') const appActions = require('../js/actions/appActions') const messages = require('../js/constants/messages') -const Filtering = require('./filtering') var isMergeFavorites = false @@ -168,7 +168,11 @@ importer.on('add-cookies', (e, cookies) => { httpOnly: cookies[i].httponly, expirationDate: cookies[i].expiry_date } - Filtering.setCookie(cookie) + session.defaultSession.cookies.set(cookie, (error) => { + if (error) { + console.error(error) + } + }) } })