Session.php (367B) download
1<?php
2Class Session{
3 if (!isset($_SESSION['CREATED'])) {
4 $_SESSION['CREATED'] = time();
5} else if (time() - $_SESSION['CREATED'] > 1800) {
6 // session started more than 30 minutes ago
7 session_regenerate_id(true); // change session ID for the current session and invalidate old session ID
8 $_SESSION['CREATED'] = time(); // update creation time
9}
10}