# onHTTPCupertinoStreamingSessionCreate called twice

**URL:** <https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [August 31, 2015, 9:42am UTC](https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716 "2015-08-31T09:42:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danijel\_Petrovic](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@Danijel\_Petrovic](https://community.wowza.com/u/Danijel_Petrovic)\
**Post date:** [August 31, 2015, 9:42am UTC](https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716/1 "2015-08-31T09:42:14Z")

</div>

I’m having strange behaviour. I’m trying to limit number of streams per user, but I’m having problem where onHTTPCupertinoStreamingSessionCreate is fired twice for the same stream. My idea was to write to MySQL database does user watch anything, and check that when Streaming Session is created, but if onHTTPCupertinoStreamingSessionCreate is fired twice for one stream, then I can’t do it this way. Any idea what could be wrong?

Also if there is some documentation about life-cycle of HTTP streaming requests in wowza it would be great.

---

<div class="post-metadata">

**Author:** ![Danijel\_Petrovic](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@Danijel\_Petrovic](https://community.wowza.com/u/Danijel_Petrovic)\
**Post date:** [August 31, 2015, 10:29am UTC](https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716/2 "2015-08-31T10:29:44Z")

</div>

When I refreshed my page, and tried again event was fired only once. So I guess multiple events has something to do with sessions? Is there a way to check this, and be sure that event is only called once per stream?

EDIT: refreshed again, but still fires twice. Weird.

---

<div class="post-metadata">

**Author:** ![Danijel\_Petrovic](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@Danijel\_Petrovic](https://community.wowza.com/u/Danijel_Petrovic)\
**Post date:** [September 3, 2015, 1:36pm UTC](https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716/3 "2015-09-03T13:36:37Z")

</div>

Thank you. I decided to place my business logic elsewhere and move it from the onHTTPCupertinoStreamingSessionCreate. As you can assume, that raise new issues 🙂 But I’ll ask in a new thread, not to post things here that are not related to the original question.

---

<div class="post-metadata">

**Author:** ![SiggDev](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@SiggDev](https://community.wowza.com/u/SiggDev)\
**Post date:** [September 1, 2015, 2:05pm UTC](https://community.wowza.com/t/onhttpcupertinostreamingsessioncreate-called-twice/45716/4 "2015-09-01T14:05:14Z")

</div>

If I remember well, this is specific to HLS (Cupertino). One session is opened for getting the list of chunks, and the other one for getting the actual chunks. I was working on something similar and came across the same problem. Again if I remember well, there was a way to distinguish between the two, I think user agent string in the request was different, you can check yourself - you should spot the difference.

The workaround would be to increase the limit for Cupertino by one, but this is just a quick fix, not a very good solution.
