make sessions expire and get removed from the database, and improve the efficiency of queries for available tasks