title: Why does Windows Media Player sometimes fail to include the appropriate cookies in requests for content when it is being used via Internet Explorer?
body: <p>We have a site hosted in IIS6 that we built using the .NET 1.1 Framework. Users who go to this site use Internet Explorer exclusively and log into it using Forms authentication. Within the site, users can navigate to a specific page that has an iFrame embedded in it. This iFrame points to another virtual directory hosted on the same server, and this second virtual directory simply streams down the movie file. Assuming the user has Windows Media Player installed on their machine and has configured it so that Windows Media Player is the default movie player, when a user navigates to the page with the iFrame, Windows Media Player pops open a new window and the movie plays.</p>
  
  <p>We very recently upgraded our software to use the .NET 3.5 framework. However, we have noticed that our movie file no longer plays. We instead get a message indicating that Windows Media Player cannot connect to the server.</p>
  
  <p>I've gone ahead and done some investigation of the network traffic between the client and server machines by using Fiddler, and these are the steps that happen in the scenario where things work:</p>
  
  <p><strong>1) Internet Explorer makes a request to the server for the movie file. The request header contains cookies that are required for proper authentication and session identification.</strong><br>
  *GET MYSITE HTTP/1.1<br>
  Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, <em>/</em><br>
  Referer: MYREFERRER<br>
  Accept-Language: en-US<br>
  User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2)<br>
  Accept-Encoding: gzip, deflate<br>
  Host: MYHOST 
  Connection: Keep-Alive<br>
  Cookie: a99fd71e-eb1b-4750-a391-5ad8cfe32068=800edb77-9649-4f93-9db9-98d678a3b166; ASP.NET_SessionId=uf1cr1bflwly0nmhbm1wnb55; EDDS=581A46E81C8DB0B475F1AFE00545F9B157A377BD31DF65BB2AEF7D1B293BDE9E178409FF251CF49F109FDC601C48F15A5FCDE1A29A18E6853357887698A01E7A2CC3690ECE98C464DE1359D796B60BE969F875EF08F638A04CDED78A309ACD6E9732F8C3751A2B0A411ADFA91B0AE567* </p>
  
  <p><strong>2) The server uses the cookies to authenticate the request from the user and then returns the movie. The status code of the return is a 200.</strong><br>
  <em>HTTP/1.1 200 OK<br>
  Date: Wed, 11 Aug 2010 21:30:55 GMT<br>
  Server: Microsoft-IIS/6.0<br>
  X-Powered-By: ASP.NET<br>
  X-AspNet-Version: 1.1.4322<br>
  Content-Length: 3934146<br>
  Accept-Ranges: bytes<br>
  Content-Disposition: inline; filename = AS000006.wmv<br>
  Last-Modified: Tue, 10 Aug 2010 21:24:49 GMT<br>
  ETag: "MyExampleFileID"<br>
  Cache-Control: private<br>
  Content-Type: application/octet-stream</em>  </p>
  
  <p><strong>3) Windows Media Player makes a request to the server for the movie file. Again, the request header contains cookies. However, this time the request includes a Range request for bytes 8192-.</strong><br>
  *GET MYSITE HTTP/1.1<br>
  Accept: <em>/</em><br>
  User-Agent: Windows-Media-Player/12.0.7600.16415<br>
  Accept-Encoding: gzip, deflate<br>
  Range: bytes=8192-<br>
  Unless-Modified-Since: Tue, 10 Aug 2010 21:24:49 GMT<br>
  If-Range: "MyExampleFileID"<br>
  Connection: Keep-Alive<br>
  Host: MYHOST<br>
  Cookie: ASP.NET_SessionId=uf1cr1bflwly0nmhbm1wnb55; EDDS=581A46E81C8DB0B475F1AFE00545F9B157A377BD31DF65BB2AEF7D1B293BDE9E178409FF251CF49F109FDC601C48F15A5FCDE1A29A18E6853357887698A01E7A2CC3690ECE98C464DE1359D796B60BE969F875EF08F638A04CDED78A309ACD6E9732F8C3751A2B0A411ADFA91B0AE567; a99fd71e-eb1b-4750-a391-5ad8cfe32068=800edb77-9649-4f93-9db9-98d678a3b166*  </p>
  
  <p><strong>4) The server uses the cookie information to authenticate the request from the user and then returns the document. The status code of the return is a 206.</strong><br>
  <em>HTTP/1.1 206 Partial Content<br>
  Date: Wed, 11 Aug 2010 21:30:57 GMT<br>
  Server: Microsoft-IIS/6.0<br>
  X-Powered-By: ASP.NET<br>
  X-AspNet-Version: 1.1.4322<br>
  Content-Range: bytes 8192-3934145/3934146<br>
  Content-Length: 3925954<br>
  Accept-Ranges: bytes<br>
  Content-Disposition: inline; filename = AS000006.wmv<br>
  Last-Modified: Tue, 10 Aug 2010 21:24:49 GMT<br>
  ETag: "MyExampleFileID"<br>
  Cache-Control: private<br>
  Content-Type: application/octet-stream</em>  </p>
  
  <p>When things don't work, it looks like this:</p>
  
  <p><strong>1) Internet Explorer makes a request to the server for the movie file. The request header contains cookies.</strong><br>
  *GET MYSITE HTTP/1.1<br>
  Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, <em>/</em><br>
  Referer:MYREFERRER 
  Accept-Language: en-US<br>
  User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2)<br>
  Accept-Encoding: gzip, deflate<br>
  Host: MYHOST<br>
  Connection: Keep-Alive<br>
  Cookie: a99fd71e-eb1b-4750-a391-5ad8cfe32068=7ac4710e-1434-43c9-b521-bdf30328e2fb; ASP.NET_SessionId=glytwo55ztohig451qrf1355; EDDS=CFC5EAE69F6D6CDD0A1D53632F01629F8AC8F4901A6106DD26A0A9F4E1E0B0EC9D4B1B78FBEF5C504A54E6B1A43F576CD846ADD3D394DF257EBBF982BED5E99900116945191268E985ED923DAA78DF4FBD68B09FF3B4D14D7092FB846012E5F464D9EBC4BA834235839A397A4F00B548D353A1AB9B67F6F960E26FC655D19D4B89347DFA2BCC7101E2397AC7EB0F105025E5A21253C0E619E809C1D9B64E53E8*  </p>
  
  <p><strong>2) The server uses the cookies to authenticate the request from the user and then returns the movie. The status code of the return is a 200.</strong><br>
  <em>HTTP/1.1 200 OK<br>
  Cache-Control: private<br>
  Content-Length: 3934146<br>
  Content-Type: application/octet-stream<br>
  Last-Modified: Wed, 11 Aug 2010 15:29:44 GMT<br>
  Accept-Ranges: bytes<br>
  ETag: "MyExampleFileID"<br>
  Server: Microsoft-IIS/7.5<br>
  X-AspNet-Version: 2.0.50727<br>
  Content-Disposition: inline; filename = AS000006.wmv<br>
  X-Powered-By: ASP.NET<br>
  Date: Wed, 11 Aug 2010 21:36:45 GMT</em>  </p>
  
  <p><strong>3) Windows Media Player makes a request to the server for the movie file. The request does <em>NOT</em> contain any cookies. The server fails to authenticate the user and the movie doesn't get sent down.</strong><br>
  *GET MYSITE HTTP/1.1<br>
  Accept: <em>/</em><br>
  User-Agent: Windows-Media-Player/12.0.7600.16415<br>
  Accept-Encoding: gzip, deflate<br>
  Range: bytes=8192-<br>
  Unless-Modified-Since: Wed, 11 Aug 2010 15:29:44 GMT<br>
  If-Range: "MyExampleFileID"<br>
  Connection: Keep-Alive<br>
  Host: MYHOST*  </p>
  
  <p>So, at this point I know exactly why it isn't working. The request from Windows Media Player doesn't contain any cookies, so our server won't authenticate the request and send down the data. What I'm completely failing to understand is why those cookies aren't being used by Windows Media Player when it makes it's request.</p>
  
  <p>All of the above requests were made from the same machine to two different sites, so I know that it isn't an issue with different versions Windows Media Player. I've reproduced the behavior on several different machines with different operating systems and different versions of IE, so it doesn't appear to be related to a specific machine. I've tried reverting back to IIS6 instead of using IIS7 for the new site, and that doesn't make a difference either. I'm left thinking it has to be something in my code, but I don't even know where to begin looking.</p>
  
  <p>My question is: Does anyone really understand how Internet Explorer passes URL information to Windows Media Player and perhaps point me in the right direction to figure this out? My only other option at this point is to open up a ticket with Microsoft support... and to be frank, my experience with their support team has been less than optimal over the past few years. Any help would be GREATLY appreciated!</p>
  
  <p>EDIT:
  Using process explorer, I've been able to prove that IE is simply not providing cookie information to Windows Media Player now. I'm still no closer to understanding why, though. </p>