I'm working on HTML5 video player which should play video streamed from a server that requires authentication. Authentication is done using PHP. In general the code looks like this:
<!-- http://localhost/video.php -->
<video preload="none" crossorigin="anonymous">
<source type="video/mp4" src="http://localhost/video_proxy.php">
</video>
So before get to /video.php user has to log in. Log in information is 'stored' in PHPSESSID cookies.
The problem is that when sending a request to http://localhost/video_proxy.php Chrome doesn't send any cookies with that request. The result is that http://localhost/video_proxy.php redirects to /login and nothing is played of course.
I was not able to find amy documentation or description of this behaviour so I'm curious how can I make Chrome to send cookies with the video request.
PS: I've checked the same scripts in Firefox and IE and that browser's behaviour is ok - cookies are sent and everything works.
PPS: I've also tried to disable all Chrome extensions, reset settings to defaults. And I've tried it on several colleague's computers - same behaviour.
the crossdomain attribute accroding to CORS settings attributes -
The "anonymous" keyword means that there will be no exchange of user credentials via cookies, client-side SSL certificates or HTTP authentication
I would think that for same domain the crossdomain attribute would be ignored, which seems the case in Firefox and IE
However, based on the fact that you stated your page and video URL are same domain, it seems Chrome has a different idea on the use of the crossdomain attribute compared with Firefox and IE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With