Hello, i have build website with login/register
in each page there is security.php include
security.php{
if (!everythingIsOkay){
exit(header('Location: /admin/login'));
}
}
job.php{
ajax{
GET: job-feed.php
Response: do stuff
},5000)
}
job-feed.php{
include security.php
Stuff that is being returned to job.php
}
thing is, it makes get requests to page every X seconds, when client information is fine it's okay, if client logs out in other tab and job-feed is being requested it should be redirected to login by security.php script
instead it doesn't redirect me but adds login page html into job.php page, and page looks mixed
How can i redirect parent page from child script, i have already tried using die but with no results