Please help me with secure token

hi, the token link expired in some minutes, but in my website the streaming goes offline afthet that time, I think it’s ok that the token link expired, but the streaming should be online anyway right? why the streaming in my main website also get stop ?

This is my example, what im doing wrong?

<?php $wowzastart = '0'; $wowzaend = strtotime(date('d-m-Y H:i')) + 1200; $secret = 'abcd'; $wowzatoken = 'token'; $hashstr=hash('sha256','stream/mystream?'.$secret.'&'.$wowzatoken.'endtime='.$wowzaend.'&'.$wowzatoken.'starttime='.$wowzastart.'', true); $usableHash= strtr(base64_encode($hashstr), '+/', '-_'); echo "http://some.com:1935/stream/mystream/playlist.m3u8?".$wowzatoken."endtime=".$wowzaend."&".$wowzatoken."starttime=".$wowzastart."&".$wowzatoken."hash=".$usableHash.""; ?>