Session Time Out Message

Hello friends,

I am developing a session oriented application in yii and I want to show a session timeout alert to user on browser.

Currently I applied a logic which show the alert on browser but in case user has opened more than 1 tabs then this logic fails.

Is there any other logic which I can apply to overcome this situation.