How to enable cookies in Electron

Asked

Viewed 87 times

3

I need to use http only cookies on Electron, but they are disabled someone knows how to enable?

1 answer

4


The environment redenderer Electron does not currently have support for the API document.cookie. Thus, libraries like Google Analytics or similar that use customer-side cookies will not work because they cannot set cookies.

To get around this problem you can use the bundle electron-cookies.

Installation

npm install electron-cookies

Use

In the code redenderer of your solution, just specify the package:

require('electron-cookies')

Your cookies will then be stored on localStorage.

Source: https://github.com/hstove/electron-cookies

  • had already used it, and I did the test again and it did not work, maybe it is pq the cookies q need are http only and javascript does not have access.

  • @Rodrigomartins I understand. I believe that there is, at the moment, no necessary support for cookies with protocol filter. =/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.