note 86638 added to session.security

From: Date: Mon, 27 Oct 2008 20:22:48 +0000
Subject: note 86638 added to session.security
Groups: php.notes 
Request: Send a blank email to php-notes+get-145842@lists.php.net to get a copy of this message
Perhaps, you would also like to timeout a session after some idle time. I noticed that session.gc_maxlifetime is not suitable for this. So I used this code to do the job: <?php if (!isset($_SESSION['timeout_idle'])) { $_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; } else { if ($_SESSION['timeout_idle'] < time()) { //destroy session } else { $_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; } } ?> ---- Server IP: 212.124.37.9 Probable Submitter: 89.55.31.224 ---- Manual Page -- http://www.php.net/manual/en/session.security.php Edit -- https://master.php.net/note/edit/86638 Del: integrated -- https://master.php.net/note/delete/86638/integrated Del: useless -- https://master.php.net/note/delete/86638/useless Del: bad code -- https://master.php.net/note/delete/86638/bad+code Del: spam -- https://master.php.net/note/delete/86638/spam Del: non-english -- https://master.php.net/note/delete/86638/non-english Del: in docs -- https://master.php.net/note/delete/86638/in+docs Del: other reasons-- https://master.php.net/note/delete/86638 Reject -- https://master.php.net/note/reject/86638 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145842) next »