diff --git a/lib/WWW/Mechanize/PhantomJS/ghostdriver/session.js b/lib/WWW/Mechanize/PhantomJS/ghostdriver/session.js index f579917..9cb4ef4 100644 --- a/lib/WWW/Mechanize/PhantomJS/ghostdriver/session.js +++ b/lib/WWW/Mechanize/PhantomJS/ghostdriver/session.js @@ -413,7 +413,7 @@ ghostdriver.Session = function(desiredCapabilities) { // decorate the new Window/Page newPage = _decorateNewWindow(newPage); // set session-specific CookieJar - newPage.cookieJar = _cookieJar; + // newPage.cookieJar = _cookieJar; // store the Window/Page by WindowHandle _windows[newPage.windowHandle] = newPage; }, @@ -657,7 +657,7 @@ ghostdriver.Session = function(desiredCapabilities) { // Decorate it with listeners and helpers page = _decorateNewWindow(page); // set session-specific CookieJar - page.cookieJar = _cookieJar; + // page.cookieJar = _cookieJar; // Make the new Window, the Current Window _currentWindowHandle = page.windowHandle; // Store by WindowHandle @@ -789,7 +789,7 @@ ghostdriver.Session = function(desiredCapabilities) { } // Release CookieJar resources - _cookieJar.close(); + // _cookieJar.close(); }, _getLog = function (type) { diff --git a/t/99-cookie_file.html b/t/99-cookie_file.html new file mode 100644 index 0000000..7fe41bb --- /dev/null +++ b/t/99-cookie_file.html @@ -0,0 +1,3 @@ + diff --git a/t/99-cookie_file.t b/t/99-cookie_file.t new file mode 100644 index 0000000..c7aa459 --- /dev/null +++ b/t/99-cookie_file.t @@ -0,0 +1,12 @@ +#!perl -w +use strict; +use Test::More tests => 1; +use File::Temp; +use WWW::Mechanize::PhantomJS; + +my $tmp = File::Temp->new; +my $mech = WWW::Mechanize::PhantomJS->new( + cookie_file => $tmp->filename, +); +$mech->get_local('99-cookie_file.html'); +ok -s $tmp->filename > 0, "cookie_file saved.";