note 71394 added to ref.session

From: Date: Sun, 26 Nov 2006 18:19:21 +0000
Subject: note 71394 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-120091@lists.php.net to get a copy of this message
If you want the simplest way there is to log a session out after 30 minutes (or any other period of inactivity) simply add a second line after session_start(), like this: session_start(); setcookie("PHPSESSID",$_COOKIE['PHPSESSID'],time()+1800); Where 1800 is the time in seconds before the session should expire. PHPSESSID is the default session ID. This way, every time a user loads a page they get their session extended. ---- Server IP: 64.71.164.2 Probable Submitter: 166.217.132.174 ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- https://master.php.net/note/edit/71394 Del: integrated -- https://master.php.net/note/delete/71394/integrated Del: useless -- https://master.php.net/note/delete/71394/useless Del: bad code -- https://master.php.net/note/delete/71394/bad+code Del: spam -- https://master.php.net/note/delete/71394/spam Del: non-english -- https://master.php.net/note/delete/71394/non-english Del: in docs -- https://master.php.net/note/delete/71394/in+docs Del: other reasons-- https://master.php.net/note/delete/71394 Reject -- https://master.php.net/note/reject/71394 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120091) next »