I am using CodeIgniter to build an application. The app is having many AJAX requests on setTimeoutInterval, which fires every few seconds.
Now the situation is: If a user has a page kept open. The page sends ajax requests at intervals. At that point of time I have updated my application in the server.
So I want to keep a version check, which notifies the user if the app has been upgraded in the meantime.
I am using CodeIgniter to build this application.
I am writhing a "post_controller" hook which will check the version in request header and the current version in the app. If something is wrong. It will send version mismatch response and exit.
Now I am able to do everything but can not stop further processing. If I am giving exit() in this particular situation, the view response is not being sent.
I can use simple echo/print. But CodeIgniter view is not sending the response if I am giving a die()/exit.