Sounds like RTMP playback. If a user is watching a video, the RTMP session has not disconnected yet. I would try some isolated tests. I suggest you take the database logging part out of it. Instead run Wowza in stand-alone (/bin/startup.bat) if you want to see logging in real-time.
I think I understand what you are seeing: with HLS streams to iOS devices there can be multiple sessions server-side for what is one playback session from the user's point of view. If you need to tie them together for accounting purposes you can
use this technique
Accounting for HLS and other HTTP stream types is not as fine as RTMP. A system like yours will have to work with what is available. The player is in control when it comes to creating these sessions, not Wowza. You might be able to
use onHTTPSessionCreate and onHTTPSessionDestroy in some way to further manage sessions.