Jump to content

[SOLVED] logging out after inactivity


stuart7398

Recommended Posts

Hi.

Can anybody assist me as to how i automically log a user out after a certain amount of time due to the user being inactive, say after 15 minutes then redirected to the login page with a message.

The code would be very helpful.

 

Where do i start?

 

 

thanks,

Stuart.

 

 

<code>

<?php

//Start session

session_start();

//Check whether the session variable

//SESS_MEMBER_ID is present or not

if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) {

header("location: access-denied.php");

exit();

}

?>

</code>

Link to comment
https://forums.phpfreaks.com/topic/100198-solved-logging-out-after-inactivity/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.