How to enable cookies on Electron

3

I need to use http only cookies in electron, but they are disabled, does anyone know how to enable?

    
asked by anonymous 15.07.2016 / 16:41

1 answer

4

The renderer environment of Electron does not currently have support for the document.cookie API. Therefore, libraries such as Google Analytics or similar that use client-side cookies will not work because they can not set cookies.

To work around this problem you can use package electron-cookies .

Installation

  

npm install electron-cookies

Use

In the renderer code of your solution, simply specify the package:

  

require('electron-cookies')

Your cookies will then be stored in localStorage .

Source: link

    
15.07.2016 / 16:50