If you meditate on this suggestion a little, questions like the following emerge:
What should happen with variables if they had been set with the -d switch, but outside of events that have a connection ID associated? Could variables be set with the -d switch while disconnected at all?
Which modifications of the $var identifier would be required? (at least one new property to return the cid of a -d variable, or 0 for a "non-d" variable)
Furthermore:
If a global variable would be linked to some connection ID, you still can have only one variable of this name. For multiserver situations, you'd have to name the variables dynamically - the way you'd do it ATM. Hence you'd only safe yourself a single "on disconnect" event (in which you'd unset all the variables that had been named to be "associated" with the late $cid).
Yes, i think that opinion before posting and i said that you will be able to find an way from the $cid , anyway it could be good to add this option