in ,

How to Check If User Has Logged Out From Other Tab


In Facebook if you are using multiple tabs and logout from any of the tabs, other tab show a popup alert, “you have logged out. Please login again.” What if you want to implement this kind of thing. One of my readers asked me to write an article on this.

Session Check AJax php

To implement this, you can use ajax calls and implement setInterval() method of js to keep checking the session.

First create a php file which returns the status of the session.


Now create a jQuery function to create ajax call and popup a message if user has logged out.

Now call this JavaScript function in every 5 or 10 seconds to keep checking sessions. I am using 5 seconds time interval




Written by Deepanker

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Leave a Reply

Your email address will not be published. Required fields are marked *


GIF Resizer Lets you Resize Animated GIF Images

5 Cool Extensions To Make Chrome’s Start Page Better And Attractive