Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Session timeout problem


Message #1 by "Amit " <amit_a_deshpande@r...> on 22 Jan 2002 10:20:30 -0000
Hi every body,=0D=0AI am using sessions (objects stored in sessions, to be 
precise )in my programme. I am facing a problem of sessions being timed out
 and thereby loosing out on those objects also which shows a dirty error me
ssage on screen "call to a member function of a non object" (something like
 this). How does the session work in php ? Are they re-initialised after ev
ery requests or they are valid only for the ** session.gc_maxlifetime ** se
conds ?. Is this session variable garbage collected after the time set for 
above said variable in php.ini in absolute terms OR is it garbage collected
 after those many seconds after the last request ?=0D=0A=0D=0AMy php.ini se
ttings are as given below. Is any change required in these settings ?=0D=0A
=0D=0A[Session]=0D=0A; Handler used to store/retrieve data.=0D=0Asession.sa
ve_handler =3D files=0D=0A=0D=0A; Argument passed to save_handler.  In the 
case of files, this is the path=0D=0A; where data files are stored.=0D=0A;s
ession.save_path =3D /tmp=0D=0Asession.save_path =3D /tmp =0D=0A; Whether t
o use cookies.=0D=0Asession.use_cookies =3D 1=0D=0A=0D=0A=0D=0A; Name of th
e session (used as cookie name).=0D=0Asession.name =3D PHPSESSID=0D=0A=0D
=0A; Initialize session on request startup.=0D=0Asession.auto_start =3D 0
=0D=0A=0D=0A; Lifetime in seconds of cookie or, if 0, until browser is rest
arted.=0D=0Asession.cookie_lifetime =3D 0=0D=0A=0D=0A; The path for which t
he cookie is valid.=0D=0Asession.cookie_path =3D /=0D=0A=0D=0A; The domain 
for which the cookie is valid.=0D=0Asession.cookie_domain =3D=0D=0A=0D=0A; 
Handler used to serialize data.  php is the standard serializer of PHP.=0D
=0Asession.serialize_handler =3D php=0D=0A=0D=0A; Percentual probability th
at the 'garbage collection' process is started=0D=0A; on every session init
ialization.=0D=0Asession.gc_probability =3D 1=0D=0A=0D=0A; After this numbe
r of seconds, stored data will be seen as 'garbage' and=0D=0A; cleaned up b
y the garbage collection process.=0D=0Asession.gc_maxlifetime =3D 7200=0D
=0A=0D=0A; Check HTTP Referer to invalidate externally stored URLs containi
ng ids.=0D=0Asession.referer_check =3D=0D=0A=0D=0A; How many bytes to read 
from the file.=0D=0Asession.entropy_length =3D 0=0D=0A=0D=0A; Specified her
e to create the session id.=0D=0Asession.entropy_file =3D=0D=0A=0D=0A;sessi
on.entropy_length =3D 16=0D=0A=0D=0A;session.entropy_file =3D /dev/urandom
=0D=0A=0D=0A; Set to {nocache,private,public} to determine HTTP caching asp
ects.=0D=0Asession.cache_limiter =3D nocache=0D=0A=0D=0A; Document expires 
after n minutes.=0D=0Asession.cache_expire =3D 180=0D=0A=0D=0A; use transie
nt sid support if enabled by compiling with --enable-trans-sid.=0D=0Asessio
n.use_trans_sid =3D 1=0D=0A =0D=0A=0D=0AThank you=0D=0A=0D=0AAmit  =0A

  Return to Index