SESSION EXPIRE, please help

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
philoo
Forum Newbie
Posts: 4
Joined: Thu May 04, 2006 4:52 am

SESSION EXPIRE, please help

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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.
philoo
Forum Newbie
Posts: 4
Joined: Thu May 04, 2006 4:52 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The garbage collection doesn't get run all the time, but at specific intervals. Look at the session.gc related ini directives.
philoo
Forum Newbie
Posts: 4
Joined: Thu May 04, 2006 4:52 am

Post by philoo »

Pimptastic | Please use

Code: Select all

,

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

,

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]
Post Reply