Search code examples
node.jsnode-webkit

How to retain cookies in node-webkit


I wish to create an application using node-webkit which does the simple job to open a remote web application. The web application has some cookie based authentication. Considering that the user has signed-in successfully, how can the required cookies be retained, so that the next time the application runs, the user will be authenticated?


Solution

  • As of 2018, NW.js retains cookies and other persistent browser data by default. These are stored in %LOCALAPPDATA%/name-in-manifest/ in Windows or equivalent depending on OS. Nothing is required from the application itself, you do not have to persist cookie data manually in local storage.