Reputation: 11740
Here is my project structure
helloWorld
-app
--package.json
--app.js
--node_modules
--public
---index.html
---package.json
---node_modules
-dist
-build
-package.json
I am running the index.html on localhost made using nodejs in electron.
I want to use persistent cookies in Electron app. In order to do this, I am using electron-cookies
but I am getting Cannot find module 'electron-cookies'
I have installed electron-cookies
in app>>package.json
and app>>public>>package.json
as well but nothing seems to be working.
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script>
require('electron-cookies')
</script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular-cookies.min.js"></script>
<meta charset="utf-8">
<title>AngularJS Cookies Example</title>
</head>
End of the day my task is to create cookies, please suggest if there is any alternative that can create persistent cookies.
Upvotes: 0
Views: 331
Reputation: 5446
You can use the native Electron Cookies interface. The electron-cookies third party lib you're trying to load seems a little out of date and is probably no longer working with current versions of Electron.
Upvotes: 0