balakrishnan.dinesh@gmail.com wrote:
Quote:
hi frnds,
>
In my page, for every user login, it will create a session
file for them with thier name itself in the default session folder, Now
i want to do is, If a person is use idle for 10 minutes, automatically
his respective session file should be deleted. How is should be, plz
tell me some idea or give some sample code
>
Thanks
Dinesh...
Hi,
Simply make the sessiontime-out 10 minutes.
You can set this in php.ini, or if php.ini is out of reach: set it manually
via ini_set.
Look for session.cookie_lifetime
About the deleting: You probably should not worry about that.
PHP will delete them itself.
How is this handled?
Each request to PHP, PHP will generate a random number and compare that to
what you defined in php.ini under:
- session.gc_probability
- session.gc_divisor
In my example, 1 in thousand times PHP will delete all old sessionfiles.
More explanation is given in php.ini and on
www.php.net.
Regards,
Erwin Moller