Gidday
I'm using AJAX to run a simple php script that updates a database. On success, php echoes a success message, which gets displayed in a javascript alert.
I also have a totally separate timeout script running on all pages, to check for inactivity of more than 20mins. If there is a timeout, the user gets redirected to the login page like so:
header('Location:
http://www.mysite.com/login');
The timeout works fine, except when using ajax as above, the whole login page html gets displayed in the alert.
It makes sense to me why it does it, but I'm unsure of the correct way to get around the problem. Is there a way to override the AJAX process in the event of a timeout, and redirect to the login page?
Thanks for your time and help.