开发者

Internet Explorer discards cookie when printing?

开发者 https://www.devze.com 2022-12-29 16:03 出处:网络
I have an unusual issue with this printing under IE开发者_如何学运维7/8 (likely 6 as well). My page contains a dynamically rendered graph. The contents of the graph are determined by the identity of

I have an unusual issue with this printing under IE开发者_如何学运维7/8 (likely 6 as well).

My page contains a dynamically rendered graph. The contents of the graph are determined by the identity of the user who visits the page. The page is not available without prior authentication.

The page loads and renders correctly in IE7/8. However, the graph does NOT print correctly. When printing or print previewing, the graph fails to load (the red x appears). I've identified that when printing, the browser attempts to reload the image, but does not send the ASPXAUTH authentication cookie along with it. This is required to generate the image (due to permission enforcement in the back-end).

Can anyone help me identify why IE decides not to send this cookie, and is there a fix? Is it related to IEs known issues with modal dialogs?


I've run into this recently. IE reloads the image on print, and does send my current site cookies. However, in my case, the image has a redirect. When IE fetches the redirect for print, it omits the cookies.

It's strange behavior, but in my case, I was able to solve it by refactoring my image generation code to not issue a redirect. I don't know how helpful that is, but I hope it might provide insight to other people coming here for answers.


This is still true in IE 9.

What happens is that when printing, IE is requesting the image again, but it not sending any cookies.

But the image has already loaded, so why not just have IE use it from the cache rather than re-requesting 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's software stack.

0

精彩评论

暂无评论...
验证码 换一张
取 消