I am using this
if (!isset($_SESSION['login_success'])): header("Location:index.php");
die();
endif;
It does work in local host but after i uploaded the site in server, when session expires it stays in the same page and not redirect to index or login page.
2
Answers
Are You sure you initialize sessions before that your code.
Try this at very top of script and let me know how it goes.
You will have to check if session is set first before including your template/top.php file. I have updated my answer to that effect. Put that code at the very top of your page –
Nancy Moore
Feb 16 at 8:49