Yii::app->close ()

Anybody can suggest me that how to check whether user is browsing a Yii app or not.Simply i want to check that user is using application…Doesn’t matter he is logged in or not… So, is there any method or way to check that yii application closed by user. Since i want to execute some code if user leave the application…

I am looking for Yii::app->close() like feature,…Anybody can help me here. :)

Thanks in advance.!!!