note 87835 rejected from function.ini-set by thiago
| From: | thiago@php.net | Date: | Fri, 26 Dec 2008 12:55:01 +0000 |
| Subject: | note 87835 rejected from function.ini-set by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148525@lists.php.net to get a copy of this message | ||
Note Submitter: jesus dot munoz at live dot com dot mx
----
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?