Webroots
Webroots

Reputation: 255

PHP session error

I am using following session variables on 3 pages:-

On Login page,

$_SESSION['login']=1;

On Logout page,

unset($_SESSION['login']);

On Home page,

if(!isset($_SESSION['login']))
{
header("location: index.php");
exit();
 }

My homepage is not redirecting to the index.php after vising Logout page.

Upvotes: 0

Views: 68

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270765

Did you call session_start() at the top of the Logout page?

Upvotes: 2

Related Questions