Page 1 of 1
SESSION EXPIRE, please help
Posted: Thu May 04, 2006 5:05 am
by philoo
Hello all,
I changed configuration php.in with
session.cache_expire = 2
(for 2 minutes)
then create
session_start() ;
$_SESSION['gone'] = "OK-OK-OK" ;
After about 10 minutes, I reactive the page , it does not expired and still have
$_SESSION['gone'] = "OK-OK-OK" ;
Why ??? Please helps
Many thanks
Philo
Posted: Thu May 04, 2006 5:14 am
by JayBird
I think you actually need to change the value of
session.gc_maxlifetime
session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up.
Posted: Thu May 04, 2006 6:52 am
by philoo
Thanks Pimptastic,
I done (for 2 minutes)
session.gc_maxlifetime = 120
But after 10 minutes the problem is the same
Page does not expired and still have
$_SESSION['gone'] = "OK-OK-OK" ;
???
Help again
Philo
Posted: Thu May 04, 2006 9:01 am
by feyd
The garbage collection doesn't get run all the time, but at specific intervals. Look at the session.gc related ini directives.
Posted: Fri May 05, 2006 2:21 am
by philoo
Pimptastic | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Many thanks Feyd,
I use PHP5 with configure :
session.auto_start = 1
register_globals = On
session.gc_maxlifetime = 120
session.gc_probability = 100
session.gc_divisor = 100
session.cache_expire = 2 ( for 2 minutes)
I writed ex1.php and ex2.php ( see code below). After 10 minutes
ex2.php does not expire.
I refresh ex2.php then get the same values for
session_id and $_SESSION['gone'] = "OK-OK-OK"
Why ??? Helps please
Philo
===========xxxxxxxxxxxxxxxxx=================
ex1.php
Code: Select all
<?php
session_start() ;
$_SESSION['id'] = session_id() ;
$idval = $_SESSION['id'] ;
echo " session_id = $idval <br><br>" ;
$_SESSION['gone'] = "OK-OK-OK" ;
echo "<a href=\"ex2.php\">VERIFY</a>" ;
?>
ex2.php
Code: Select all
<?php
session_start() ;
$iv = $_SESSION['id'] ;
$igo = $_SESSION['gone'] ;
echo "session_id = $iv <br><br>" ;
echo "session_gone = $igo" ;
?>
Pimptastic | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]