Reset MySQL table data after each session is completed in php
Setup:


Take a mysqldump of the 'default' data.
Put the output into a Stored Procedure.
Modify the stored procedure to also CREATE DATABASE and USE that database.  The database name would be dynamic -- probably the user id, with something prepended to avoid naming conflicts.  Also surround with backtics.


User comes in:


perform that stored procedure.


User leaves.  This could be tricky -- what if he stays logged in?  what if some server dies without getting to this code?  Etc.  There may need to be something that runs around periodically to clean up orphaned databases.


Drop his database.


Note:  Your question implied that everyone is using the same database.  I switched to having everyone use a different database.