On Feb 21, 5:50 am, ajd...@gmail.com wrote:
> Hi
>
> From what I understand, a session is deleted after the browser window
> is closed. I have been trying to work out why the session file remains
> on the server (it is named something like sess_3ghy6...) and has to be
> manually deleted. I want to avoid having hundreds of these files
> collecting on the server and would appreciate any advice on why they
> aren't automatically deleting when the browser closes.
>
> Here is part of my php info file if that s.
>
> session.auto_start Off Off
> session.bug_compat_42 On On
> session.bug_compat_warn On On
> session.cache_expire 180 180
> session.cache_limiter nocache nocache
> session._domain no value no value
> session._lifetime 0 0
> session._path / /
> session._secure Off Off
> session.entropy_file no value no value
> session.entropy_length 0 0
> session.gc_divisor 100 100
> session.gc_maxlifetime 1440 1440
> session.gc_probability 1 1
> session.name PHPSESSID PHPSESSID
> session.referer_check no value no value
> session.save_handler files files
> session.save_path .\ .\
> session.serialize_handler php php
> session.use_ On On
> session.use_only_ Off Off
> session.use_trans_sid Off Off
>
> Thanks
> Andrew
The server doesn't immediately delete session files, it does so during
a garbage collection cycle. One thing you can do if you are concerned
about space and you do have your users log out, is during log out is
either use session_destroy(); or empty the session array ($_SESSION =
array()
Check out this page and look for garbage collect to learn more:
http://www.oreilly.com/catalog/webdb...pter/ch08.html
Larry