title: Flutter: How correctly maintain session for file Download / or extract Embed PDF via JavaScript?
body: <p>I am stuck a little with a file Download.
  I am navigating with an Headless-InAppWebView to a certain page which contains a pdf file embedded in an iframe.</p>
  <pre><code>&lt;iframe src=&quot;../xyz.pdf&quot; /&gt;
  </code></pre>
  <p>I need to download this PDF file to the device. Right now I always used</p>
  <pre><code>CookieManager().getCookies()
  </code></pre>
  <p>and Flutter Downloader or a simple http.get with the Cookies inside the Header.</p>
  <pre><code>http.get(fileurl, headers: {&quot;Cookie&quot;:cookies});
  </code></pre>
  <p>However this does not seem do to the Job for all pages.</p>
  <p>On another Server this results in error not authorized. How do I correctly maintain the session from WebView to Download a file from there, or is there another way to extract the bytes from the embedded file? Or maybe extract the file from WebView Cache?</p>
  <p>Many thanks in advance!</p>