I'm tracking users behaviour by using a table to store their download progress status.
It's something like:
user_id
file_id
lastupdate
'lastupdate' is a column that holds a timestamp of the last time that row was updated. If the difference between the current time and 'lastupdate' is more than 120 secs I delete the row so that the user can try again to download the file. You can obviously tune it for the exact time. You can bring it down to 10 secs but then you have to be sure that the user transfers at least some packets every 10 seconds.
Do not do the update on the table for every transferred packet or you would bring up issues with db performances. You'd rather update it at fixed time intervals while downloading.
I hope I've been clear enough and have given you some pointers.