{"action":"created","issue":{"url":"https://api.github.com/repos/segmentio/nightmare/issues/345","labels_url":"https://api.github.com/repos/segmentio/nightmare/issues/345/labels{/name}","comments_url":"https://api.github.com/repos/segmentio/nightmare/issues/345/comments","events_url":"https://api.github.com/repos/segmentio/nightmare/issues/345/events","html_url":"https://github.com/segmentio/nightmare/issues/345","id":117010997,"number":345,"title":"Initiate a Nightmare instance without cookies/cache from old sessions","user":{"login":"alfonsomga","id":9363272,"avatar_url":"https://avatars.githubusercontent.com/u/9363272?v=3","gravatar_id":"","url":"https://api.github.com/users/alfonsomga","html_url":"https://github.com/alfonsomga","followers_url":"https://api.github.com/users/alfonsomga/followers","following_url":"https://api.github.com/users/alfonsomga/following{/other_user}","gists_url":"https://api.github.com/users/alfonsomga/gists{/gist_id}","starred_url":"https://api.github.com/users/alfonsomga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfonsomga/subscriptions","organizations_url":"https://api.github.com/users/alfonsomga/orgs","repos_url":"https://api.github.com/users/alfonsomga/repos","events_url":"https://api.github.com/users/alfonsomga/events{/privacy}","received_events_url":"https://api.github.com/users/alfonsomga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/segmentio/nightmare/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-15T19:00:57Z","updated_at":"2015-11-17T05:33:16Z","closed_at":null,"body":"I'm trying to figure out how I can start a new and clean Nightmare instance (without cookies or cache from an old session).\r\n\r\nIn my below example the bot basically navigates to ``m.facebook.com`` types an ``email``and a ``password`` then it clicks on the ``login`` button, the first time the bot did all this correctly but second time I ran this script the bot was already logged and failed, how can I avoid this?\r\n\r\n```javascript\r\n\tnew Nightmare({show: true})\r\n    \t.useragent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36')\r\n        .goto('https://m.facebook.com')\r\n        .wait()\r\n        .type('input[placeholder=\"Email or Phone\"]', email)\r\n        .type('input[placeholder=\"Password\"]', password)\r\n        .click('button[name=\"login\"]')\r\n        .wait(1000)\r\n        .wait()\r\n        .exists('div[id=\"m_home_notice\"]')\r\n        .run(function(err, nightmare) {\r\n            if (err) return console.log(err);\r\n            console.log('Done!');\r\n        });\r\n```"},"comment":{"url":"https://api.github.com/repos/segmentio/nightmare/issues/comments/157275001","html_url":"https://github.com/segmentio/nightmare/issues/345#issuecomment-157275001","issue_url":"https://api.github.com/repos/segmentio/nightmare/issues/345","id":157275001,"user":{"login":"rosshinkley","id":1823131,"avatar_url":"https://avatars.githubusercontent.com/u/1823131?v=3","gravatar_id":"","url":"https://api.github.com/users/rosshinkley","html_url":"https://github.com/rosshinkley","followers_url":"https://api.github.com/users/rosshinkley/followers","following_url":"https://api.github.com/users/rosshinkley/following{/other_user}","gists_url":"https://api.github.com/users/rosshinkley/gists{/gist_id}","starred_url":"https://api.github.com/users/rosshinkley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosshinkley/subscriptions","organizations_url":"https://api.github.com/users/rosshinkley/orgs","repos_url":"https://api.github.com/users/rosshinkley/repos","events_url":"https://api.github.com/users/rosshinkley/events{/privacy}","received_events_url":"https://api.github.com/users/rosshinkley/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T05:33:16Z","updated_at":"2015-11-17T05:33:16Z","body":"@alfonsomga After some tinkering, I figured out what is happening.  The `defaults` library - which is used to merge passed options with default options - does not merge deeply.  When we were passing in options to `web-preferences`, the existing options - the parts that load most of the sugar that allows Nightmare to work - were getting overwritten.\r\n\r\nI've gone ahead and submitted a fix, pending approval (#348)."}}