note 87835 added to function.ini-set
| From: | jesus dot munoz at live dot com dot mx | Date: | Thu, 25 Dec 2008 16:52:04 +0000 |
| Subject: | note 87835 added to function.ini-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148504@lists.php.net to get a copy of this message | ||
Recently, I've used this function, but maybe i don't understand the functionality yet. I
explain this:
I was working with ini_set trying to give a life time for the sessions, for example: I want that
sessions won't exist after 10 seconds and I try with the next code:
<?php
function test_ini_set()
{
if ($_SESSION["us"])
{
echo "Sesion exists";
echo "<br />".$_SESSION["us"];
//session_destroy();
}
else
{
$_SESSION["us"] = "Nuevo valor";
echo "Sesion doesn't exists";
echo "<br />".$_SESSION["us"];
}
}
session_start();
ini_set("session.gc_maxlifetime","10");
test_ini_set();
?>
The first time that i execute the script the output is:"Sesion doesn't exists" but, I
try again and now the output is "Sesion exists", for the next time I wait 11 seconds, but
the output doesn't is "Sesion doesn't exists", is "Sesion exists"
again..
I don't undestand this behavior, anyone knows how can resolve this?
----
Server IP: 148.206.80.9
Probable Submitter: 200.66.51.104
----
Manual Page -- http://www.php.net/manual/en/function.ini-set.php
Edit -- https://master.php.net/note/edit/87835
Del: integrated -- https://master.php.net/note/delete/87835/integrated
Del: useless -- https://master.php.net/note/delete/87835/useless
Del: bad code -- https://master.php.net/note/delete/87835/bad+code
Del: spam -- https://master.php.net/note/delete/87835/spam
Del: non-english -- https://master.php.net/note/delete/87835/non-english
Del: in docs -- https://master.php.net/note/delete/87835/in+docs
Del: other reasons-- https://master.php.net/note/delete/87835
Reject -- https://master.php.net/note/reject/87835
Search -- https://master.php.net/manage/user-notes.php