Forum Moderators: coopster

Message Too Old, No Replies

php delete all variables if user navigates away

         

jason_m

4:11 pm on May 12, 2010 (gmt 0)

10+ Year Member



i am sure this has been posted numerous times.

i am open to criteria of either "if coming from source: abcdef.com" or "if going to site outside of mydomain.com"

any help would be largely appreciated.

rocknbil

6:40 pm on May 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you mean session variables? They will die on their own in 25 minutes or so. Or data in database tables?

The only immediate solution is in a window.onload() event via Javascript/Ajax. Even that may be unreliable as it can be disabled by the user or the onload event can be blocked by AVG or popup blockers, which have been known to block all load/unload events in some cases.

MatthewHSE

7:26 pm on May 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to delete database data, you could write a little cron script to delete data after a specified period of inactivity.