0% found this document useful (0 votes)
30 views2 pages

Session Validation

Uploaded by

Dawit Sebhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Session Validation

Uploaded by

Dawit Sebhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Session validation

session_start();
isset($_POST['adminlog'])
f (!empty($_SERVER["HTTP_CLIENT_IP"])) {
$ip =
$_SERVER["HTTP_CLIENT_IP"];
$host =
gethostbyaddr($_SERVER['REMOTE_ADDR']
Session validation
$expireAfter = 60.
if (isset($_SESSION['last_action'])) {
$secondsInactive = time() -
$_SESSION['last_action'];
$expireAfterSeconds = $expireAfter * 60;
if ($secondsInactive >= $expireAfterSeconds) {
session_unset(); session_destroy(); }}
$_SESSION['last_action'] = time();

You might also like