Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php session_start(); $timeout = 20; if (isset($_SESSION['STARTED']) && (time() - $_SESSION['STARTED'] > $timeout)) { session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } if(isset($_SESSION['status']) && $_SESSION['status'] == 1){ exit("sorry"); } // do somethins and mark session status 1 $_SESSION['status'] = 1; $_SESSION['STARTED'] = time(); var_export($_SESSION);
Copy Clear