I want to let an alert box pop up after a user's session expire. My problem is I can't the alert box isn't displaying.
The alert box isn't working if I put the unset session but it'll work if there is no unset session. I know using alert('')
isn't ideal so I'm wondering if there's a simple way to create such pop up.
My code is something simple like this
echo "
<script>
alert('Your Session has expired for inactivity. Please log in again');
</script>";
unset($_SESSION['admin_log']);
unset($_SESSION['admin_time_log']);