Page 1 of 1
php session's
Posted: Sun Jul 25, 2004 5:58 am
by pelegk2
i have noticed that in PHP the session is save in the HD under the user temp folder (on winXP at least)!
is this always?or it depends the apache configuration?
and if so why when the sessions end's the session fiels arent deleted???
beacuse its a security matter!
thnaks in advance
peleg
Re: php session's
Posted: Sun Jul 25, 2004 8:07 am
by Buddha443556
pelegk2 wrote:i have noticed that in PHP the session is save in the HD under the user temp folder (on winXP at least)!
You can set a different location using
session.save_path directive.
pelegk2 wrote:is this always?or it depends the apache configuration?
/tmp on the HD is the default. As I said above you can change that location usually. You could also use shared memory not available on Windows though.
pelegk2 wrote:and if so why when the sessions end's the session fiels arent deleted???
beacuse its a security matter!
Old session are deleted during garbage collection. You may want to play with these configuration options
session.gc_probability,
session.gc_divisor and
session.gc_maxlifetime.
One more thing:
THE MANUAL wrote:Note: If you are using the default file-based session handler, your filesystem must keep track of access times (atime). Windows FAT does not so you will have to come up with another way to handle garbage collecting your session if you are stuck with a FAT filesystem or any other fs where atime tracking is not available. Since PHP 4.2.3 it has used mtime (modified date) instead of atime. So, you won't have problems with filesystems where atime tracking is not available.
what i meant :
Posted: Mon Jul 26, 2004 3:47 am
by pelegk2
u wrote :
As I said above you can change that location usually. You could also use shared memory not available on Windows though.
what i meant was if or how can i make php not to use files for session but only the memory?
Posted: Mon Jul 26, 2004 8:22 am
by Buddha443556
OSSP mm by Ralf S. Engelschall.
THE README from mm wrote:OSSP mm is a 2-layer abstraction library which simplifies the usage of shared memory between forked (and this way strongly related) processes under Unix platforms. On the first (lower) layer it hides all platform dependent implementation details (allocation and locking) when dealing with shared memory segments and on the second (higher) layer it provides a high-level malloc(3)-style API for a convenient and well known way to work with data-structures inside those shared memory segments.
This library was successfully tested on FreeBSD, OpenBSD, NetBSD, BSDI, Linux, SunOS, Solaris, Tru64, AIX, A/UX, HP-UX, ReliantUNIX, IRIX, UnixWare and even Win32 Cygwin, BeOS and OS/390.
THE MANUAL- shmop wrote:Note: Versions of Windows previous to Windows 2000 do not support shared memory. Under Windows, Shmop will only work when PHP is running as a web server module, such as Apache or IIS (CLI and CGI will not work).
You might try writing a custom session handler using shmop might work on XP.
Might look at
Class: shmem.