# onHTTPSessionCreate does not trigger

**URL:** <https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720>\
**Category:** Wowza Streaming Engine\
**Created:** [January 11, 2013, 10:18pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720 "2013-01-11T22:18:12Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 11, 2013, 10:18pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/1 "2013-01-11T22:18:12Z")

</div>

Hi,

I found a problem in wowza.

We set up a live-origin-edge service with wowza.

If user play url like “http://[edgeServerIP]/live/myStream/playlist.m3u8?wowzasessionid=xxxxx”

It will not trigger onHTTPSessionCreate.

The log is

```auto
INFO server comment - onAppStart: live/_definst_
INFO application app-start _definst_ live/_definst_
INFO server comment - onStreamCreate
INFO stream create - -
INFO server comment - MediaStreamHTTPStreamerRepeaterBuffer.initLiveStreamRepeating: receiverClass: com.wowza.wms.httpstreamer.cupertinostreaming.liverepeater.CupertinoStreamerLiveRepeaterReceiver
INFO server comment - onPublish
INFO server comment - LiveMediaStreamReceiver.connect: rtmp://[originServerIP]:1935/live/_definst_/myStream
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.close: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.resetStream: live/_definst_/myStream:cupertinostreamingpacketizer
INFO server comment - onStreamCreate
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.initLiveStreamPacketizer: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTarget: 10000
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTolerance: 500
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: audioGroupCount: 3
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: playlistChunkCount:3
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:myStream
INFO cupertino connect 235766135 -
INFO server comment - onStreamCreate
INFO server comment - MediaStreamHTTPStreamerRepeaterPlay: startPlay
INFO stream create rtmp://[originServerIP]:1935/live/_definst_/myStream
INFO stream play rtmp://[originServerIP]:1935/live/_definst_/myStream

```

If user play url like “http://[edgeServerIP]/live/myStream/playlist.m3u8”

It works fine.

The log is

```auto
INFO server comment - onAppStart: live/_definst_
INFO application app-start _definst_ live/_definst_
INFO server comment - onStreamCreate
INFO stream create - -
INFO server comment - MediaStreamHTTPStreamerRepeaterBuffer.initLiveStreamRepeating: receiverClass: com.wowza.wms.httpstreamer.cupertinostreaming.liverepeater.CupertinoStreamerLiveRepeaterReceiver
INFO server comment - onPublish
INFO server comment - LiveMediaStreamReceiver.connect: rtmp://[originServerIP]:1935/live/_definst_/myStream
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.close: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.resetStream: live/_definst_/myStream:cupertinostreamingpacketizer
INFO server comment - onStreamCreate
INFO server comment - CupertinoStreamerLiveRepeaterReceiver.initLiveStreamPacketizer: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTarget: 10000
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTolerance: 500
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: audioGroupCount: 3
INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: playlistChunkCount:3
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:myStream
INFO cupertino connect 1949153657 -
INFO server comment - onStreamCreate
INFO server comment - MediaStreamHTTPStreamerRepeaterPlay: startPlay
INFO stream create rtmp://[originServerIP]:1935/live/_definst_/myStream
INFO server comment - onHTTPSessionCreate: 1949153657
INFO server comment - onHTTPCupertinoStreamingSessionCreate: 1949153657
WARN server comment - reject session id: 1949153657
WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/myStream/playlist.m3u8]: Session not accepted[1949153657]

```

Since we authorize our user in onHTTPCupertinoStreamingSessionCreate event handler, it will cause we cannot reject illegal user if they take wowzasessionid in query string.

Thanks,

Roy

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 12, 2013, 12:08am UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/2 "2013-01-12T00:08:38Z")

</div>

Roy,

In my test, adding wowzasessionid did not have that affect. onHTTPSessionCreate did run. I compiled this:

```auto
package test;
import com.wowza.wms.httpstreamer.model.IHTTPStreamerSession;
import com.wowza.wms.module.*;
import com.wowza.wms.application.*;
public class ModuleAccessControlHTTPStreaming extends ModuleBase
{
	public void onHTTPSessionCreate(IHTTPStreamerSession httpSession)
	{
		boolean isGood = true;
		
		String ipAddressClient = httpSession.getIpAddress();
		String ipAddressServer = httpSession.getServerIp();
		String queryStr = httpSession.getQueryStr();
		String referrer = httpSession.getReferrer();
		String cookieStr = httpSession.getCookieStr();
		String userAgent = httpSession.getUserAgent();
		
		IApplicationInstance appInstance = httpSession.getAppInstance();
		String streamName = httpSession.getStreamName();
		
		// Here you can use the request and session information above to determine 
		// if you want to reject the connection
		// isGood = true/false;
		
		getLogger().info("ModuleAccessControlHTTPStreaming.onHTTPSessionCreate["+appInstance.getContextStr()+":"+streamName+"]: accept:"+isGood);
		
		if (!isGood)
			httpSession.rejectSession();
	}
}

```

And added this module to /conf/vod/Application.xml for my test:

```auto
<Module>
	<Name>ModuleAccessControlHTTPStreaming</Name>
	<Description>ModuleAccessControlHTTPStreaming</Description>
	<Class>test.ModuleAccessControlHTTPStreaming</Class>
</Module> 

```

I ran with and without wowzasessionid and both times see “INFO server comment - ModuleAccessControlHTTPStreaming.onHTTPSessionCreate[vod/_definst_:sample.mp4]: accept:true” in the console.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 14, 2013, 2:21pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/3 "2013-01-14T14:21:08Z")

</div>

Roy,

I will have to test more later today. Are you able to establish a playback session that actually plays using a made-up wowzasessionid, or one from another session?

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 14, 2013, 5:58pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/4 "2013-01-14T17:58:16Z")

</div>

I have been testing and I don’t think this is an issue. Wowza ignores a made-up wowzasessionid, and onHTTPCreateSession runs as necessary, in applications with StreamType live, vod and liverepeater-edge in my tests

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 15, 2013, 4:42pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/5 "2013-01-15T16:42:20Z")

</div>

Roy,

I’ll test again. Did you get the wowzasessionid from another session? Or is it the string length?

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 17, 2013, 10:34pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/6 "2013-01-17T22:34:43Z")

</div>

Roy,

I tried again, I cannot replicate. If I add ?wowzasessionid=1682498420 to the playlist.m3u8 in the html page, onHTTPSessionCreate still runs in a livestream-edge application.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 2, 2013, 2:19pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/7 "2013-05-02T14:19:33Z")

</div>

SK,

Can you detail what is going on in your case? onHTTPSessionCreate should fire for each cupertino, smooth or sanjose session. There is a complete example here:

[https://www.wowza.com/docs/how-to-control-access-to-http-streams-cupertinostreaming-sanjosestreaming-smoothstreaming-mpegdashstreaming](https://www.wowza.com/docs/how-to-control-access-to-http-streams-cupertinostreaming-sanjosestreaming-smoothstreaming-mpegdashstreaming)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 3, 2013, 1:14pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/8 "2013-05-03T13:14:36Z")

</div>

What version of Wowza are you running? The problem Roy discovered was fixed in Wowza 3.5.1. You can update to Wowza 3.5.2 by applying the 3x-3.5.2 patch here:

[https://www.wowza.com/docs/wowza-streaming-engine-software-updates](https://www.wowza.com/docs/wowza-streaming-engine-software-updates)

You can also apply the latest dev patch while you are at it to be current:

[https://www.wowza.com/docs/wowza-streaming-engine-software-updates](https://www.wowza.com/docs/wowza-streaming-engine-software-updates)

Richard

---

<div class="post-metadata">

**Author:** ![Karim\_SLIMANI](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Karim\_SLIMANI](https://community.wowza.com/u/Karim_SLIMANI)\
**Post date:** [May 2, 2013, 2:23pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/9 "2013-05-02T14:23:47Z")

</div>

hi,

any updates for this ? i am having the same problem.

This is annoying if you make a server module using onHTTPSessionCreate() to protect http stream which is bypassed with this _trick_ …

-SK

---

<div class="post-metadata">

**Author:** ![Karim\_SLIMANI](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Karim\_SLIMANI](https://community.wowza.com/u/Karim_SLIMANI)\
**Post date:** [May 2, 2013, 3:32pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/10 "2013-05-02T15:32:36Z")

</div>

> SK,
> 
> Can you detail what is going on in your case? onHTTPSessionCreate should fire for each cupertino, smooth or sanjose session. There is a complete example here:
> 
> [Control access to HTTP streams with the Wowza Streamin](https://www.wowza.com/docs/how-to-control-access-to-http-streams-cupertinostreaming-sanjosestreaming-smoothstreaming-mpegdashstreaming)
> 
> Richard

Richard,

it is the same context as explained in previous posts : in a liverepeater-edge situation, some clients access the cupertino stream using an URL in the following format :

```auto
http://mydomain.tld/app_name/_definst_/stream_name/playlist.m3u8?wowzasessionid=218840585&v=hghpl

```

With this URL, the onHTTPSessionCreate() is not triggered. Currently, i have no idea how they get the value of wowzasessionid (even if i shutdown and start the server, the direct URL work and does not trigger the event).

-SK

---

<div class="post-metadata">

**Author:** ![Karim\_SLIMANI](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Karim\_SLIMANI](https://community.wowza.com/u/Karim_SLIMANI)\
**Post date:** [May 3, 2013, 2:29pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/11 "2013-05-03T14:29:13Z")

</div>

Richard,

i tested my module with Wowza 3.5.2 (using Linux OS) and probleme still here.

BUT, my module was compiled on a Wowza IDE using Wowza 3.0.3. I am gonna re-install IDE and Wowza 3.5.2 and compile module again and try again tests.

I will post my results when it is done.

-SK

---

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 12, 2013, 1:06pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/12 "2013-01-12T13:06:36Z")

</div>

Hi, Richard

Thanks for your testing.

In my test, if Application StreamType set to VOD or Live.

It works fine with and without wowzasessionid.

The problem only occurs if Application StreamType set liverepeater-edge.

The edge server version is “#Software: Wowza Media Server 3.1.2 build1624”

The origin server version is “#Software: Wowza Media Server 2.2.3.12 build27289”

Thanks,

Roy

---

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 15, 2013, 10:55am UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/13 "2013-01-15T10:55:59Z")

</div>

Richard,

Thanks for your testing again.

My reproduce step is

1. start up wowza

2. connect live-repeater application with some specific wowzasessionid

3. device playbacks video but server does not log onHTTPSessionCreate

In this case, is this wowzasessionid a made-up session?

Wowza server just start up and never allocate session.

The client just take wowzasessionid in query string, it makes itself a valid session and playback without any authentication.

Something strange is that some specific wowzasessionid can work, not any random number could cause this problem.

Thanks,

Roy

---

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 16, 2013, 2:00pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/14 "2013-01-16T14:00:15Z")

</div>

I found this problem because some invalid user play our stream for a while with those specific wowzasessionid.

I have no idea how they get these specific wowzasessionid.

And these wowzasessiond works on other wowza server(ex: my testing server) in my reproduce step.

Here are some example

wowzasessionid=1682498420

wowzasessionid=400685476

wowzasessionid=1770083500

wowzasessionid=149622051

Thanks,

Roy

---

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 21, 2013, 5:05pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/15 "2013-01-21T17:05:59Z")

</div>

Richard,

I have re-installed the last version wowza.(Wowza Media Server 3.5.0 build2989)

And use your sample code to build module and modify the config file to setup liverepeater-edge application.

The problem still exists.

I will send config and log files to support@wowza.com

Please help me to check what’s wrong with my setting.

Thanks,

Roy

---

<div class="post-metadata">

**Author:** ![Roy\_Wu](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@Roy\_Wu](https://community.wowza.com/u/Roy_Wu)\
**Post date:** [January 24, 2013, 11:49am UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/16 "2013-01-24T11:49:43Z")

</div>

Hi,

I am waiting for update information from wowza support team.

They found the first connection after wowza server start will cause this problem.

My short term solution is adding a server listener to check each HTTP session if it is valid periodically.

This is not the best solution, but it can reduce most impact of network bandwidth for me.

Roy

---

<div class="post-metadata">

**Author:** ![Gabriel\_Nepot](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Gabriel\_Nepot](https://community.wowza.com/u/Gabriel_Nepot)\
**Post date:** [January 23, 2013, 3:55pm UTC](https://community.wowza.com/t/onhttpsessioncreate-does-not-trigger/37720/17 "2013-01-23T15:55:59Z")

</div>

Hello Roy,

If you find the solution, can you share with us? I have the same problem with one of my clients…

Thanks!
