I'd like to understand how to save cookies that the application writes to
document.cookie (https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie), as I've noticed that the common methods wget/curl to save to a file does not work for this particular case, it seems.
Assuming the web app writes cookies:
document.cookie = name + "=" + value + expires + "; path=/";
wget --keep-session-cookies --save-cookies cookies.txt "http://foobar/app-generates-cookie.html"
or the curl,
curl --cookie-jar cookie.txt http://foobar/app-generates-cookie.html
Both wget/curl does not work for the app case above.