How to print (by a printer machine) all cookies in a webpage?

How to print (by a printer machine) all cookies in a webpage?

I have tried this which didn’t work:

window.print(document.cookie);

This allows me to print the entire webpage instead only the cookies.

I have found this way to do it:

const x = document.write(document.cookie);
window.print(x);

After The browser changed the location to the new location with only cookie data, I could printed them.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.