Time-Based/Scheduled Profiles Issue

New Contributor
I hope you are all ok…
I have an issue with Web filtering Profiles.
I have created a profile, which allows only specific websites during School hours but if students leave youtube open in a Safari tab from the day before, when they come to school they can browse youtube normally even though the profile was activated.
Only typing the youtube.com URL in the address bar blocks it.
Do you have any suggestions?
Below you can see the video-recorded using zoom. 

Contributor III

Create a policy to run a script which will check for a logged in user, then close/quit every web browser. Set the policy's execution frequency to once per day and use the Client-Side Limitations to only run whenever the profile's hours are not in place.

Thank you for the reply. Do you have any sample scripts which i can use or modify because i don't know?