hy I have created two panels first is members panel and second is admin panel. In these two panels, I have created a session file in those panels.
but when I logged in into members panel and without log out from this panel, I go to admin panel it does not ask any username or password it's taken me to direct index page.
members panel :
<?php
include('db.php');
session_start();
$user_check = $_SESSION['login_user'];
$ses_sql = mysqli_query($conn,"select email from outlet where email = '$user_check' ");
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session = $row['email'];
if(!isset($_SESSION['login_user'])){
header("location:login.php");
}
?>
Admin Panel :
<?php
include('db.php');
session_start();
$user_check = $_SESSION['login_user'];
$ses_sql = mysqli_query($conn,"select email from admin where email = '$user_check' ");
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session = $row['email'];
if(!isset($_SESSION['login_user'])){
header("location:login.php");
}
?>