# HTTP Cupertino session Reject

**URL:** <https://community.wowza.com/t/http-cupertino-session-reject/40725>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [October 2, 2013, 10:31am UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725 "2013-10-02T10:31:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tome\_N1](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@Tome\_N1](https://community.wowza.com/u/Tome_N1)\
**Post date:** [October 2, 2013, 10:31am UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/1 "2013-10-02T10:31:40Z")

</div>

I have the following issue logged recently on a server.

Using Wowza 3.6.2.12 (same problem with Wowza 3.6.2.01).

There is a code for checking if a client can connect to the stream, similar to this

```auto
public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamerSessionCupertino httpSession) 
	{		
		String status = Check.onConnect(httpSession.getAppInstance().getApplication().getName(), httpSession.getIpAddress());//Handeled in class, if exception Rejected
		if(!status.equals("Rejected")) 
		{
			//it is allowed
		}
		else
		{
				httpSession.rejectSession();
				
				WMSLoggerFactory.getLogger(null).error("DEBUG onHTTPCupertinoStreamingSessionCreate Rejected Status: " + status +
						" app: " + httpSession.getAppInstance().getApplication().getName() + " IP: " + httpSession.getIpAddress() + " Referrer: " + httpSession.getReferrer());
		}

```

This works ok, until a connection is rejected. Here what is inside the log

```auto
DEBUG onHTTPCupertinoStreamingSessionCreate Rejected Status: Rejected, app: live IP: xx.xx.xx.xx Referrer: something

```

This means that the session is rejected and logged, but after this is logged in the logs I get “infinite” log entries like this

```auto
WARN	server	comment	2013-10-02	00:33:17	-	-	-	-	-	38080.186	-	-	-	-	-	-	-	-	HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/_definst_/myStream/chunklist_w1329948076.m3u8]: Session not accepted[1329948076]

```

this is logged on every 2 sec until the server stopped and was restarted.

Maybe it is nothing because is a warning but few days ago only 4 sessions like this had cause increase in the production servers cpu and ram and crached the wowza server.

Why is this behavior logged , what to change to avoid problems?

Need answer fast because it is close to peak time and I want to avoid restarting the server.

Regards,

---

<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:** [October 2, 2013, 1:49pm UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/2 "2013-10-02T13:49:00Z")

</div>

What player are you using? I do not see that happening in my test when I do httpSession.rejectSession() where the device browser is using a simple HTML5 page with video tag and playlist.m3u8 url. I see one of those log lines per rejected session, e.g. “Session not accepted[1837545612]”

The number is a session id. If each of those is different, then they are different sessions. Perhaps you are using a player that keeps trying to connect.

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 3, 2014, 2:47pm UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/3 "2014-01-03T14:47:46Z")

</div>

Denis,

It looks like Wowza is doing its part. Wowza cannot stop the player from trying. It looks like the player has received the playlist.m3u8 file, possibly a .smil file. So I presume you did httpSession.rejectSession() later than onHTTPSessionCreate.

I’m hesitant to download and run this .exe file. Other players do not require an executable to install.

Try onHTTPSessionDestroy to handle rejected sessions:

```auto
public void onHTTPSessionDestroy(IHTTPStreamerSession httpSession)
	{
	}

```

Richard

---

<div class="post-metadata">

**Author:** ![Denis\_Chetverikov](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Denis\_Chetverikov](https://community.wowza.com/u/Denis_Chetverikov)\
**Post date:** [January 3, 2014, 10:22am UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/4 "2014-01-03T10:22:55Z")

</div>

Hi,

I am faced the same problem, some players continue requests even after the session rejected or redirected. I understand that it is the question to the player implementation but Wowza Media Server do not close the session in the right way in this case, I mean onHTTPStreamerSessionDestroy does not fired in this case and for me this is quite important thing.

I have tried to close the session with

```auto
httpSession.rejectSession();

```

httpSession.shutdown();

but this player (PotPlayer) still trying to get the ts files and update playlist

> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onMediaFile[vod/_definst_/mp4:sample.mp4/media\_w1051553829\_51.ts]: Session not accepted.
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onMediaFile[vod/_definst_/mp4:sample.mp4/media\_w1051553829\_52.ts]: Session not accepted.
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onMediaFile[vod/_definst_/mp4:sample.mp4/media\_w1051553829\_53.ts]: Session not accepted.
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onMediaFile[vod/_definst_/mp4:sample.mp4/media\_w1051553829\_54.ts]: Session not accepted.
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[vod/_definst_/mp4:sample.mp4/chunklist\_w1051553829.m3u8]: Session not accepted[1051553829]
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[vod/_definst_/mp4:sample.mp4/chunklist\_w1051553829.m3u8]: Session not accepted[1051553829]
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[vod/_definst_/mp4:sample.mp4/chunklist\_w1051553829.m3u8]: Session not accepted[1051553829]
> 
> WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[vod/_definst_/mp4:sample.mp4/chunklist\_w1051553829.m3u8]: Session not accepted[1051553829]
> 
> Here you can download the PotPlayer:
> 
> [http://daumpotplayer.com/download/](http://daumpotplayer.com/download/)
> 
> This issues has been reproduced with this version of PotPlayer
> 
> [http://daumpotplayer.com/wp-content/uploads/2013/03/PotPlayer1.5.40688-x64.exe](http://daumpotplayer.com/wp-content/uploads/2013/03/PotPlayer1.5.40688-x64.exe)
> 
> using Wowza Media Server 3.6.3 under Windows 8.1 64bit.
> 
> Denis

---

<div class="post-metadata">

**Author:** ![Daniele\_Napolitano](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Daniele\_Napolitano](https://community.wowza.com/u/Daniele_Napolitano)\
**Post date:** [September 9, 2014, 1:44pm UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/5 "2014-09-09T13:44:42Z")

</div>

Is this the same reason that keep very high cupertino connections?

When I execute a getConnectionCounts command from the JMXCommandLine, I always get lots of Cupertino Connections!!

There’s a way to solve it without restart the server.

Daniele

---

<div class="post-metadata">

**Author:** ![Maanas\_Royy](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@Maanas\_Royy](https://community.wowza.com/u/Maanas_Royy)\
**Post date:** [August 16, 2014, 1:43am UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/6 "2014-08-16T01:43:50Z")

</div>

Hi there,

I notice that there appears httpSession.rejectSession() is not firing. I m trying to evaluate inside onHTTPSessionCreate and explicitly calling httpSession.rejectSession and it does not works.

Any suggestion.

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [August 17, 2014, 11:30pm UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/7 "2014-08-17T23:30:49Z")

</div>

Do you have any logs to provide surrounding the onHTTPSessionCreate event and your rejection call? Do you see the destroy in the logs?

---

<div class="post-metadata">

**Author:** ![Tome\_N1](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@Tome\_N1](https://community.wowza.com/u/Tome_N1)\
**Post date:** [October 2, 2013, 3:09pm UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/8 "2013-10-02T15:09:32Z")

</div>

I didn’t logged the user agent to know exactly because it is production server the session is made by some user (90% chance it’s a Roku).

The warning lines are all the same in the log, if a session 1329948076 is rejected then it is logged in every 2 sec, if another session is rejected then that one plus the previous is logged and the logs are flooded.

Also I don’t know if you noticed in the log it says that a **chunklist** is being rejected, this is not very clear to me. If I reject a HTTP session will that session be able to get the chunklist with a session like it is logged live/_definst_/myStream/chunklist\_w1329948076.m3u8?

---

<div class="post-metadata">

**Author:** ![charles\_ravindran](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@charles\_ravindran](https://community.wowza.com/u/charles_ravindran)\
**Post date:** [October 11, 2017, 2:06am UTC](https://community.wowza.com/t/http-cupertino-session-reject/40725/9 "2017-10-11T02:06:36Z")

</div>

Hi I am also facing the same issue i couldn’t reproduce the same using potplayer in my development environment but it is frequently happening in production. Is there any other way to reproduce it? did you able to solve this issue?

Charles
