Re: Session management module - thoughts
| From: | Sascha Schumann | Date: | Mon, 31 May 1999 10:58:49 +0000 |
| Subject: | Re: Session management module - thoughts | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-6321@lists.php.net to get a copy of this message | ||
On Mon, May 31, 1999 at 09:28:37AM +0200, Stig Bakken wrote:
> On Sat, 29 May 1999, Juan A. Pons wrote:
>
> > STILL the biggest drawback in the ASP session mgmt model is that it is
> > compeletely machine based, there are solutions out there but none seem
> > that reliable. So that web users need to go back to the same server for
> > every request. If the server dies, the session info goes along with it.
> > If you are using only one server that's fine and dandy, but when you
> > are adding multiple systems to your application for load balancing and
> > fault tolerance configurations, this is not really useful.
>
> I saw "callback functions" mentioned a while back in this thread. If
> these are implemented for the session stuff, you can store your sessions
> in any way you see fit without adding complexity to PHP's code.
>
> - Stig
Yes, these user provided functions could be one solution to the problem. If
that does not satisfy the end-user he might choose to create his own ps_module
(stands for PHP session module or persistent save module, whatever you like
better):
typedef struct ps_module_struct {
char *name;
int (*open)(PS_OPEN_ARGS);
int (*close)(PS_CLOSE_ARGS);
int (*read)(PS_READ_ARGS);
int (*write)(PS_WRITE_ARGS);
int (*delete)(PS_DELETE_ARGS);
int (*gc)(PS_GC_ARGS);
} ps_module;
I believe this small "API" to be enough for even complexer modules such as the
RPC client/server model which was presented on this list not long ago. We
provide a file based module by default which uses a simple directory to store
its session data.
The session module is fully configurable. The new generalized INI support made
it possible to implement the configuration part in about a dozen lines. This
part will be extended to provide IPPs with the necessary options to prevent
users from doing malicious things.
I'm currently working on the serialization part which still has some problems
with correct reference counting and destruction of zvals.
--
Regards,
Sascha Schumann
Consultant
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net