Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 video/audio player on mobile Safari (iOS 7 & iOS 10) excludes cookies

I have noticed that the HTML5 video/audio player (AppleCoreMedia) on mobile Safari on iOS 7 excludes all cookies, even first-party cookies. Not even sessions cookies are included in the HTTP-header. This makes it impossible to relay on cookie authorization when playing a video clip in mobile Safari on iOS 7.

All cookies are included correctly running iOS 6 but on iOS 7 no cookies are included in the HTTP-header of AppleCoreMedia.

Can some one else confirm this issue on iOS 7?

Steps to reproduce is:

  1. Create a cookie on a web page.
  2. Play a HTML5 video clip on the same web page using mobile Safari in iOS 7.
  3. Check the server logs for AppleCoreMedia and look for the cookie.

Update 2016-09-20: The video player in iOS 10 (AppleCoreMedia) is not able to read session cookies. Only cookies set with an expire date is readable by the video player.

like image 824
Kalle Avatar asked Oct 06 '13 23:10

Kalle


People also ask

Does Safari support HTML5 player?

Safari supports HTML5. If YouTube video doesn't play, try either disabling or uninstalling extensions like ClickToFlash. Just not 4K HTML5 streaming video, as Google has gagged that feature in preference of their own proprietary streaming protocol that does support 4K.

Does Safari allow video autoplay?

In Safari, go to "Settings for This Website." Go to the right of Auto-Play, and click the pop-up menu to choose your preferred option: Allow All Auto-Play. Stop Media with Sound.

How do I make a video play in Safari?

In the Safari app on your Mac, navigate to the web video you want to play. Compatible web videos have an AirPlay icon in the video controls in the bottom of the video window. Click the AirPlay icon , then choose your Apple TV.

Does Safari support MP4?

MP4 is a container format, while H. 264 is a video compression codec. So to play H. 264 in Safari, you will need a video container like MP4 to host the encoded video.


2 Answers

For iOS10, if you respond with a 403 forbidden, AppleCoreMedia will somehow try again but this time with the missing cookies. If you have code that redirects to login page when the session cookie is missing, video will not work on iOS 10.

like image 74
Henry Yang Avatar answered Oct 19 '22 17:10

Henry Yang


I have developed a simple test where you can check if your iOS device have this bug.

Read more about the test here!

like image 30
Kalle Avatar answered Oct 19 '22 18:10

Kalle