hello please i need help writing a php code to redirect my user to the login page after a session time.
OK, post what you have done so far and any issues or error messages you are getting.
Hi @fabulouschineme ,
Just check your session, if the session userame is not set just redirect it to index or where ever you want.
if(isset($_SESSION['username'])) {
$user = $_SESSION['username'];
$loginid = $_SESSION['loginid'];
}else{
header("Location: index.php");
exit();
}
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.