Internet Explorer discards cookies on printing?

I have an unusual problem with this printing in IE7 / 8 (most likely 6).

My page contains a dynamically rendered graph. The content of the graph is determined by the ID of the user who visits the page. The page is unavailable without prior authentication.

The page loads and renders correctly in IE7 / 8. However, the graph does NOT print correctly. When printing or previewing a print, the graph does not load (a red x appears). I found that when printing, the browser tries to reload the image, but does not send the ASPXAUTH authentication cookie with it. This is needed to create the image (due to the forced resolution in the background).

Can anyone help me determine why IE chooses not to send this cookie and is there a fix? Is this related to IE with known issues with modal dialogs?

+2


a source to share


2 answers


I ran into this recently. IE reloads the image on print and sends my current site cookies. However, in my case, the image has a redirect. When IE fetches the redirect for printing, it skips the cookies.



This is weird behavior, but in my case, I was able to solve it by refactoring the image generation code to not issue a redirect. I don't know how useful this is, but I hope it can provide insight to other people who have come here for answers.

+1


a source


This is still true in IE 9.

It happens that when printing, IE asks for the image again but does not send cookies.

But the image has already been loaded, so why not just use IE from the cache and not re-request the image?



All you have to do is when the image is requested, set the response headers to tell the browser to cache the image.

How to do this depends on your server software stack.

0


a source







All Articles