i am a student and i am new in php
i am working on my project
i have two panels in my website (localhost) one is user other is admin
in both panels i hace created sessions on all pages
on user panel:
session_start();
if(!isset($_SESSION['user']))
header("Location: index.php");
on admin panel:
session_start();
if(!isset($_SESSION['username']))
{
header("Location: login.php?e=please+login+first");
}
now i have opened both panels and problem is that if i logout from one panel then other panels also logout .
forexample if i logout in user panel as a user then my admin panel session automatically redirect page to login.php when i refresh admin page
is there any way to avoid this or how to avoid this.. please help me. i shall be thankful
here is my logout code
for admin side
<?php
session_start();
session_destroy();
header("Location: login.php?e=Logout+successfully");
?>
for user side
<?php
session_start();
session_destroy();
header("Location: index.php?l=Logout+successfully");
}
?>