1

We've noticed that for some users of our website, they have a problem that if they following links to the website from external source (specifically Outlook and MS Word) that they arrive at the website in such a way that User.IsAuthenticated is false, even though they are still logged in in other tabs.

After hours of diagnosis, it appears to be because the FormsAuthentication cookie is not sent sometimes when the external link is clicked. If we examine in Fiddler, we see different headers for links clicked within the website, versus the headers which are as a result of clicking a link in a Word document or Email. There doesn't appear to be anything wrong with the cookie (has "/" as path, no domain, and a future expiration date).

Here is the cookie being set:

Set-Cookie: DRYXADMINAUTH2014=<hexdata>; expires=Wed, 01-Jul-2015 23:30:37 GMT; path=/

Here is a request sent from an internal link:

GET http://domain.com/searchresults/media/?sk=creative HTTP/1.1
Host: domain.com    
Cookie: Diary_SessionID=r4krwqqhaoqvt1q0vcdzj5md; DRYXADMINAUTH2014=<hexdata>;

Here is a request sent from an external (Word) link:

GET http://domain.com/searchresults/media/?sk=creative HTTP/1.1
Host: domain.com
Cookie: Diary_SessionID=cpnriieepi4rzdbjtenfpvdb

Note that the .NET FormsAuthentication token is missing from the second request. The problem doesn't seem to be affected by which browser is set as default and happens in both Chrome and Firefox.

Is this normal/expected behaviour, or there a way we can fix this?

NickG
  • 9,315
  • 16
  • 75
  • 115
  • Possible duplicate of [Why are cookies unrecognized when a link is clicked from an external source (i.e. Excel, Word, etc...)](https://stackoverflow.com/questions/2653626/why-are-cookies-unrecognized-when-a-link-is-clicked-from-an-external-source-i-e) – IMSoP Jul 16 '18 at 12:19

1 Answers1

0

Turns out this a known issue with Microsoft Word, Outlook and other MS Office products: <sigh>

See: Why are cookies unrecognized when a link is clicked from an external source (i.e. Excel, Word, etc...)

Summary: Word tries to open the URL itself (in case it's an Office document) but gets redirected as it doesn't have the authentication cookie. Due to a bug in Word, it then incorrectly tries to open the redirected URL in the OS's default browser instead of the original URL. If you monitor the the "process" column in Fiddler it's easy to see the exact behaviour from the linked article occurring:

enter image description here

Community
  • 1
  • 1
NickG
  • 9,315
  • 16
  • 75
  • 115