djsadinoff
djsadinoff

Reputation: 5612

How does MS-Word open a hyperlink?

I have an MS-Word document with a hyperlink. The hyperlink points at an authentication redirector on my server. When I control-click on the hyperlink, my server logs report that it

  1. does a fetch with IE, then
  2. fetches the redirect url with IE, then
  3. launches the "default browser", which is Firefox in my case, and re-fetches the second (redirect) URL.

What gives? Is this by design?

I noticed this because my auth system is currently dependent on cookies set by the redirector. I have some ideas about using url-based auth for this bit, but I need to know what is motivating Word's behavior first.

I have some guesses but I'm looking for something authoritative (or at least a better-informed guess).

Upvotes: 14

Views: 9648

Answers (3)

Paul R
Paul R

Reputation: 31

Late addition:

Noticed the same problem. Here with MVC 4 it caused the loss of querystring information. Word launches the browser only after it receives a Http 200 status.

So I avoided this by checking in the controller whether the request comes from IE7 (representing likely only to be MS Word) and returning a 200 manually.

Then the 'real' browser will re-send the http request and all's well ends well, since from there the request is processed normally and all information is retained in the session with the 'real' browser.

Bit of a workaround, but hey, it works. And it's only for a small amount of requests (in our case).

Upvotes: 3

Chuck Wagner
Chuck Wagner

Reputation: 151

Actually, this is a "feature". If the hyperlink is to a Word document, word will attempt to download the document and open it. (You must be thinking it's IE because of the user-agent, but the request is coming from WinInet in the the Word process.)

The mess comes about when the server doesn't respond with a page, but rather responds with a redirect and cookies. Word follows the redirect to see if it's going to get a Word document, and it eventally ends up with an HTML page. It then decides that Firefox should display it, so it launches Firefox with the final redirected URL, (but without any of the cookies that the server sent).

Firefox may end up needing those cookies, if this is an SSO sign-on.

Upvotes: 15

Ezran
Ezran

Reputation: 2847

Unfortunately, yes. And they try to blame it on "a limitation of the single sign-on system used by the web server"...

http://support.microsoft.com/kb/899927

Upvotes: 17

Related Questions