So I have a full fledged working website where user can login and register. Now when a user login i create a user session and use that to maintain the login state.
Now my site has few video content which is hosted in my server. These are suppose to be accessible only when the user is logged in. But right now anyone having the direct link to the media is able to view them without login.
Current webiste folder structure looks like this:

So i am trying to solve 2 problems:
- If user try to access the link directly and not logged in should be redirected to login page.
- If the user is logged in already he should be able to view the resource even with direct links?
What approach do you suggest? I don't want to stop user using .htaccess force authentication as some mobile browser don't support it and would like to redirect user to login page for un auth access.