My readers are asking that how do we display message to users that their sessions got expired. So I thought this tutorial will really useful to lots of web developer who working on session based websites.I have used javascript timing event –  setInterval() – executes a function, over and over again, at specified time intervalsThe setInterval() method will wait a specified number of milliseconds, and then execute a specified function, and it will continue to execute the function, once at every given time-interval.
Ajax PHP