I have a small website that works like below
1) User goes to the login page and enters the credentials (call it page1)
2) The form gets posted to page2, which authenticates the user, calls
session_start and then sets a session variable with $_SESSION['somevar'] and
redirects to the page3
3) On page3 , I check if the $_SESSION['somevar'] is set if not send the user back to the login page
//here's the code on the top of the page3
<?php
session_start();
if (!isset($_SESSION['somevar'])) { header("Location:http://somesite") }
...other code follows
The problem is while this works in FireFox, even with correct user credentials IE 7 keeps on redirecting back to page1 instead of displaying the contents of page3.
Some pointer please to solve this?
EDIT : A very weird solution but it works. I changed
if (!isset($_SESSION['somevar'])) { header("Location:http://somesite") }
to
if ($_SESSION['somevar'] == '' ) { header("Location:http://somesite") }
and IE is happy now. But I am still clueless as to why isset
didn't work in IE
Many Thanks