I am building a web-app that users can upload certain files and work on them through the web-app interface. I need to store these files for the length of a users session. I
If you have access to the crontab or scheduled tasks of the server you could create a php file that only is allowed to execute locally which checks the expiration Date/Time value of all sessions found in your database. Each time a user updates this expiration Date/Time value would be updated to their next timeout value (+30 minutes, etc.).
Your scheduled task/crontab would find all those users who idled out and clean up the mess they left without logging off. I wouldn't suggest to have your scheduled task/crontab run too often. At least have the reoccurance spaced out a number of minutes that makes sense for your situation.