title: Flask limiting user sessions by time
body: <p>I have rather unusual task, so I would like to ask for a piece of advice from experts :) </p>
  
  <p>I need to build small Flask-based web which will have build-in video player. Users will have to log-in to access videos. The problem is that I need to limit user by the amount of time they can spend using the service.</p>
  
  <p>Could someone please recommend a possible way to make it work or help me to find a place to get started?</p>
  
  <p>What I am thinking of... what if i create user's profile variable like "credits_minutes", and i could find a way to decrease credits_minutes every minute by one? </p>