Sessions
What are sessions?
Sessions determine whether MistServer sees a certain connection as a new one or as a previously existing one when a connection is made. This is quite important as certain protocols can establish multiple connections but should be counted as a single viewer.
Sessions are the tool that allows you to specify when you would want something to be counted as a new user to track, or when to bunch certain statistics together. As one might expect this is extremely important for monitoring tasks.
How do they work
MistServer tracks sessions on 4 different categories:
- Viewers are outside connections requesting an stream output (to view) from MistServer
- Inputs are connections going into MistServer providing stream data
- Outputs are connections started by MistServer going to another location
- Unspecified are connections that do not fall under any of the other categories. (requesting stats for example)
Any of these connections made that fall in the categories above will be rated according to 4 different values:
- Stream name: Whenever a new
streamis used/requested - IP address: Whenever the address of of the requestee or target changes
- Token: Whenever a provided or generated token is different
- Protocol: Whenever the protocol used to distribute the stream data is changed. This can be set/generated through cookies and/or url parameters
When a connection is made it will be judged on the options depending on which category the connection falls. If all measured options exactly match a previous session it will be marked as an existing session and any statistics are merged.
The defaults for sessions
Viewers Any viewer that changes on the following values will be considered new:
- IP address
- Token
- Stream name
By watching these 3 values viewers can be authorized for every new stream they are trying to watch, protocol switches for viewers aren't deemed important as long as the IP address, Token and Stream name were previously cleared.
Inputs Any input that changes on the following values will be considered new:
- IP address
- Token
- Stream name
- Protocol
This basically comes down to any input, whether VoD or Live will be considered new unless the exact same stream was coming in and was simply interrupted and continued. However this would mean the input has to be continued before it timed out as instead of token the process identifier (PID) is used.
Outputs Any output that changes ont he following values will be considered new:
- IP address
- Token
- Stream name
- Protocol
Any started output by MistServer that isn't exactly the same will be considered a new output. Since every output uses the PID as an token every output that is started will be a new session.
Unspecified Unspecified sessions are not tracked at all by default. One exception would be the HTTP only session which is how the MistPlayer connects to MistServer when loaded it. This is recognized as a viewer session through the defaults to allow access control triggers/hooks to reject before any streaming data is send.