I have created a system in which i have two types of users: Authentic users Demo users
Authentic users are the users that are real life users,all data belonging to these users is needed. Demo users are the users which are fake users created for demonstration purpose only.Information of such users is not needed.
When an authentic user logs in he performs operations and saves his data and logs out .All information is saved in database.
When demo user logs in he performs same operations and logs out.I have created a script which deletes all the data of the demo user when log out.This works perfectly.
The problem arises when the demo user does not log out but just closes the browser.The delete script does not run which is present on the 'logout page' .
I want something that would run the script on the closing of the browser and the delete is successful.