Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Php :: How to format a json response in php 
Php :: symfony server start port 
Php :: php counter 
Php :: Delete an array in multidimensional array php 
Php :: session variable in laravel 
Php :: check if array value exists in another array php 
Php :: delete all cookies in php 
Php :: php get current month first date 
Php :: current url wordpress 
Php :: convert byte to megabyte php 
Php :: php run command line 
Php :: Laravel randomise data from database 
Php :: how to display the taxonomy image in wordpress 
Php :: PHP substr_count — Count the number of substring occurrences 
Php :: phpspreadsheet read xlsx 
Php :: item count in cart quantitiy woocommerce 
Php :: how to find total rows fetched php pdo 
Php :: exec command not working in php but works in terminal 
Php :: laravel update by id 
Php :: Http request with bearer token Laravel 
Php :: laravel model query limit 
Php :: php get value from url 
Php :: laravel foreach 
Php :: ubuntu laravel storage permission 
Php :: create a modal livewire laravel 
Php :: laravel collection prepend 
Php :: File Reading Mode PHP 
Php :: store multiple session in laravel 
Php :: php datetime set timezone 
Php :: get featured image id wordpress 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =