Firefox and embedded WMP - got cookie problems
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
Firefox and embedded WMP - got cookie problems

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web
Author Message
Granger Godbold
Guest





Posted: Fri Feb 04, 2005 11:40 pm    Post subject: Firefox and embedded WMP - got cookie problems Reply with quote

I'm trying to deliver .wmv files through an .aspx page that handles
permissions. It all works in IE6, but it does not when I attempt the
same in Firefox.

WMP gives the (useless) error message: "Windows Media Player cannot play
the file. One or more codecs required to play the file could not be
found." Nowhere could I determine *what* actually happened; no details;
no, "You need a codec that can play this..." information; nothing. It
even got the name of the file it was trying to play incorrect!

For a long time, I thought that, for whatever reason, WMP was ignoring
the mime-type that was being sent, and, instead, it was going off the
file's extension. What is *actually* happening is WMP is sending
different cookies than Firefox when it requests the file---that's the
root of the problem.

Does someone know why WMP is not sending the same cookies as Firefox? Is
WMP ignoring the cookies? Is Firefox not passing them on? Is this by
design or a bug? If it's by design, could someone point me to something
that tells me how I'm expected to work around this?


MORE DETAILS (If you care)
=====================================
On the web page where the video is supposed to play, I'm doing the
"standard" embedding Html code (the object tag does the ActiveX way and
the embed tag does the Netscape-plugin way):

<object id="wmvIE"
classid="6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject"
width="X" height="Y"
Quote:

<param name="Url" value="/some/file.aspx?name=value"

<embed type="application/x-mplayer2"
src="/some/file.aspx?name=value"
width="X" height="Y"
Quote:
></embed
</object



Here's the sequence of events. (I simplified the Http headers I got from
Ethereal to the stuff that I think matters):

1) Firefox requests the file and sends the session-cookie; it gets a
"200 OK" response and the video is delivered.

GET /somepath/media.aspx?stream=1234 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20041107 Firefox/1.0
Cookie: ASP.NET_SessionId=sfimtg45...; CS_AUTH_TOKEN=1DC32...


2) Next, WMP (AKA "NSPlayer") attempts to fetch the file, but sends a
*different* session-cookie. (Also, FYI, if WMP is trying to get a file
with the ".wmv" extension, the User-Agent is "NSPlayer/10.0.0.3646
WMFSDK/10.0")

GET /somepath/media.aspx?stream=1234 HTTP/1.1
User-Agent: Windows-Media-Player/10.00.00.3646
Cookie: ASP.NET_SessionId=2wmhxkym...


My authorization code rejects the attempt and returns a "302 found"
response that redirects the client to my login page (standard Asp.Net
"Forms Authentication" stuff). WMP then attempts to play this file and
correctly reports that it can't. (Had it bothered to tell me it was
trying to "play" my login.aspx page instead, that would've helped! Or,
if it had at least told me that it needed a codec to play "text/html"
that might also have tipped me off.)

Back to top
Neil Smith [MVP Digital M
Guest





Posted: Sat Feb 05, 2005 1:51 am    Post subject: Re: Firefox and embedded WMP - got cookie problems Reply with quote

Does it work if you use session cookies ?

How about if you append the session cookie ID to the URL for WMP, and
then read that as part of the request? It would be no less secure than
you are now (where the cookie is sent as part of the HTTP header)
since WMP would request it and the client (and browser) need not see
the cookie value.

HTH
Cheers - Neil

On Fri, 04 Feb 2005 11:40:45 -0700, Granger Godbold
<granger.godbold@FILLER.prometric.com> wrote:

Quote:
I'm trying to deliver .wmv files through an .aspx page that handles
permissions. It all works in IE6, but it does not when I attempt the
same in Firefox.

WMP gives the (useless) error message: "Windows Media Player cannot play
the file. One or more codecs required to play the file could not be
found." Nowhere could I determine *what* actually happened; no details;
no, "You need a codec that can play this..." information; nothing. It
even got the name of the file it was trying to play incorrect!

For a long time, I thought that, for whatever reason, WMP was ignoring
the mime-type that was being sent, and, instead, it was going off the
file's extension. What is *actually* happening is WMP is sending
different cookies than Firefox when it requests the file---that's the
root of the problem.

Does someone know why WMP is not sending the same cookies as Firefox? Is
WMP ignoring the cookies? Is Firefox not passing them on? Is this by
design or a bug? If it's by design, could someone point me to something
that tells me how I'm expected to work around this?


MORE DETAILS (If you care)
=====================================
On the web page where the video is supposed to play, I'm doing the
"standard" embedding Html code (the object tag does the ActiveX way and
the embed tag does the Netscape-plugin way):

<object id="wmvIE"
classid="6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject"
width="X" height="Y"

<param name="Url" value="/some/file.aspx?name=value"
<embed type="application/x-mplayer2"
src="/some/file.aspx?name=value"
width="X" height="Y"
></embed
</object


Here's the sequence of events. (I simplified the Http headers I got from
Ethereal to the stuff that I think matters):

1) Firefox requests the file and sends the session-cookie; it gets a
"200 OK" response and the video is delivered.

GET /somepath/media.aspx?stream=1234 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20041107 Firefox/1.0
Cookie: ASP.NET_SessionId=sfimtg45...; CS_AUTH_TOKEN=1DC32...


2) Next, WMP (AKA "NSPlayer") attempts to fetch the file, but sends a
*different* session-cookie. (Also, FYI, if WMP is trying to get a file
with the ".wmv" extension, the User-Agent is "NSPlayer/10.0.0.3646
WMFSDK/10.0")

GET /somepath/media.aspx?stream=1234 HTTP/1.1
User-Agent: Windows-Media-Player/10.00.00.3646
Cookie: ASP.NET_SessionId=2wmhxkym...


My authorization code rejects the attempt and returns a "302 found"
response that redirects the client to my login page (standard Asp.Net
"Forms Authentication" stuff). WMP then attempts to play this file and
correctly reports that it can't. (Had it bothered to tell me it was
trying to "play" my login.aspx page instead, that would've helped! Or,
if it had at least told me that it needed a codec to play "text/html"
that might also have tipped me off.)
Back to top
Granger Godbold
Guest





Posted: Sat Feb 05, 2005 2:28 am    Post subject: Re: Firefox and embedded WMP - got cookie problems Reply with quote

Both cookies are session cookies already. With my original post, I guess
I was more interested in figuring out where the cookies are getting
lost. Either Firefox is not passing the cookies to the plugin (by design
or from a bug), or WMP is not properly accepting the cookies (through
the legacy plugin interface that's used when one uses the "embed" tag).

I'm hoping someone that's "in the know" at Microsoft could confirm that
WMP accepts cookie-type information via that plugin interface, or they
could confirm that the plugin interface has no provisions for passing
cookie information.


Oh, and thanks for the suggestion; that's the direction I'm going to
workaround the problem since I doubt another solution will present itself.

Thanks =)
Granger

Neil Smith [MVP Digital Media] wrote:
Quote:
Does it work if you use session cookies ?

How about if you append the session cookie ID to the URL for WMP, and
then read that as part of the request? It would be no less secure than
you are now (where the cookie is sent as part of the HTTP header)
since WMP would request it and the client (and browser) need not see
the cookie value.

HTH
Cheers - Neil
[snip]


Back to top
Granger Godbold
Guest





Posted: Mon Feb 07, 2005 10:13 pm    Post subject: Re: Firefox and embedded WMP - got cookie problems Reply with quote

To whomever cares,
I've got a workaround now. I still do not know for certain if it's a
bug or by-design that the cookies aren't used by the plugin. While
looking through the Netscape Plugin API (NPAPI), I found a function that
one would use to request info from the browser, but no mention was made
of cookies. Perhaps it could be used to pass cookies, and perhaps not.
The long and short of it is that cookies aren't passed.

What I did to work around the problem was to create a new .aspx page to
point the NPAPI plugin at. My <embed> tag points WMP to it and appends
the SessionID to the Url. This new .aspx page takes that param and
updates the session-cookie that WMP is using, then redirects it to the
actual Url to get the video. And, yes, I did take extra precautions to
stop people from using this new page as a backdoor into the site; thanks
for looking out for me. =)

Granger


Granger Godbold wrote:
Quote:
Both cookies are session cookies already. With my original post, I guess
I was more interested in figuring out where the cookies are getting
lost. Either Firefox is not passing the cookies to the plugin (by design
or from a bug), or WMP is not properly accepting the cookies (through
the legacy plugin interface that's used when one uses the "embed" tag).

I'm hoping someone that's "in the know" at Microsoft could confirm that
WMP accepts cookie-type information via that plugin interface, or they
could confirm that the plugin interface has no provisions for passing
cookie information.


Oh, and thanks for the suggestion; that's the direction I'm going to
workaround the problem since I doubt another solution will present itself.

Thanks =)
Granger
Back to top
genzeto
Guest





Posted: Fri Apr 29, 2005 4:30 pm    Post subject: Re: Firefox and embedded WMP - got cookie problems Reply with quote

This problems is caused by the plugin looking in the Microsoft location
for cookies - but its wrapping firefox browser storing then in anotehr
Mozilla specific location - so the embedded player does not find the
cookies where it expects them



--
genzeto
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1402364.html
Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB