Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

set session expire time in php

if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) {
    // last request was more than 30 minutes ago
    session_unset();     // unset $_SESSION variable for the run-time 
    session_destroy();   // destroy session data in storage
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #session #expire #time #php
ADD COMMENT
Topic
Name
5+9 =