note 96867 added to function.session-set-cookie-params

From: Date: Fri, 19 Mar 2010 22:40:53 +0000
Subject: note 96867 added to function.session-set-cookie-params
Groups: php.notes 
Request: Send a blank email to php-notes+get-167236@lists.php.net to get a copy of this message
The information above about this function that it can only be used BEFORE session_start depends on how you use it. Because its also useful AFTER a session has started as follows: Example you wand to change an already set value of the session cookie expire time: <?php // Here we start as usual session_set_cookie_parameters('3600'); // 1 hour session_start(); // More code... // Now we found in some database that the user whishes // the cookie to expire after for example 10 minutes // we can change it instantly ! session_set_cookie_parameters('600'); // 10 minutes. session_regenerate_id(true); // This will delete old cookie and adopt new expire settings and the // old cookie variables in a new cookie ?> Please note i only explained the browser (client) side changes of session cookie's expire time. ---- Server IP: 69.147.83.197 Probable Submitter: 213.46.14.116 ---- Manual Page -- http://www.php.net/manual/en/function.session-set-cookie-params.php Edit -- https://master.php.net/note/edit/96867 Del: integrated -- https://master.php.net/note/delete/96867/integrated Del: useless -- https://master.php.net/note/delete/96867/useless Del: bad code -- https://master.php.net/note/delete/96867/bad+code Del: spam -- https://master.php.net/note/delete/96867/spam Del: non-english -- https://master.php.net/note/delete/96867/non-english Del: in docs -- https://master.php.net/note/delete/96867/in+docs Del: other reasons-- https://master.php.net/note/delete/96867 Reject -- https://master.php.net/note/reject/96867 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167236) next »