[PHPLIB] RE: [PHP3] persistent data From: nklem <email protected>
Date: 03/29/00

On Wed, 29 Mar 2000, you wrote:
> > Yes, but how is this persistence implemented? Is there a
> > mechanism for preserving these variables in server memory?
>
> Not in server memory. While server side session management
> would be awesome, I don't know how feasible that would be.
> As of right now, the only way I know of to keep persistant data
> is through the use of client side cookies.

I'm experimenting with phplib, and I strongly suspect that it is possible to
configure the class sessions to store itself and children in some kind of
shared machine-memory. The example configuration file comes like this:

#class Example_CT_Shm extends CT_Shm {
# var $max_sessions = 500; ## number of maximum sessions
# var $shm_key = 0x123754; ## unique shm identifier
# var $shm_size = 64000; ## size of segment
#}

Where CT_Shm refers to a class in the native phpfile ct_shm.inc, class being
without any mysql connection AFAIK.
But it's beyond me how they do it, so I don't use it. I store that kind of
things in mysql together with a $session_id that again is stored in a
browser-cookie. My mysql-load can be heavy on extreme-low-bud machinery, so I
save the possibillity of dividing up the mysql-connections between separate
tables and possibly databases/machines, instead of solely using the provided
mysql-data-container class CT_Sql. The $session_id is a randomly HUGE number
(possible with 4096bits pgp-signed message anyone?), and therefore relatively
safe as browser_id. If security is an issue, use at least an Apache-SSL-module
in addition.

This is of course included as a default installation of phplib 7.2 @

http://phplib.netuse.de
(Published under the GNU LIBRARY GENERAL PUBLIC LICENSE).

and is (not tested) implemented in php4.0.

For phplib READ THE DOCUMENTATION in phplib/doc slowly though, it's packed with
details of mechanisms and howto use it as a ready package. It's use of php is
advanced. IMHO you should understand why it works before you try breaking it.
Follow the installation instructions and life will be kind.

nicholas
nklem <email protected>
"Use the source Luke, use the source"

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.