Subject Re: Firebird php session handling functions?
Author willogibbo
I didn't think that my post would prompt such response and debate (but
it's interesting that it has!)

The reasons for wanting to save PHP session data in a FB dbase are
really twofold. As background I am working on a small user group web
application (as opposed to a public web site).

While there can be multiple users active in the app, there are certain
groups of pages where i can only allow one user at a time. Storing the
users' current pages in a session variable in a table that holds info'
on all active sessions means that I can query where all users are, and
prevent a user accessing a page if someone else is in that group of
pages. Doing this as part of a php session (as opposed to an ordinary
table) has the advantage that if a user quits the browser then the
session can cleared up (php garbage collector) after a period etc.

A second reason (really a variation on above) is so that an
administrator can query all the active sessions to understand which
pages the users are on at any given time etc..

Now maybe this is not the best way to do all this - I am keen to be
educated. (e.g. I don't see how to do this with the default 'files'
php sessions approach)

In terms of implementing this I have progressed and got the sessions
being saved in a FB table. A further problem has arisen, however,
which is that I seem to have difficulty saving 'timestamp strings' as
session variables e.g. '21.06.2006 10:00:00'. I suspect what may be
happening here is that php has trouble serializing/unserializing this
as it contains full stops and colons. Not sure how to deal with this
at the moment.

Thanks for the discussion on this - very illuminating.
Will

--- In firebird-php@yahoogroups.com, "willogibbo" <willogibbo@...> wrote:
>
> I am re-visiting this and trying to get php to use firebird for
> storing php sessions.
>
> There are plenty of exmaples of the various php functions required for
> MySQL but I haven't found anything yet done in Firebird. Anyway, I
> have created a set of functions i.e. sessionOpen, sessionClose,
> sessionRead etc.. as best I can, but I don't think I've even got past
> php recognising the Firebird database and table as the storage as I'm
> getting the error "Failed to initialize storage module".
>
> Firstly, in php.ini, I am wondering how exactly to specify the
> "session.save_path" and "session.name" configs. Would
> "/opt/firebird/city/city.fdb" and "tblphpsessions" be valid (e.g. is
> the .fdb suffix required or not?.
>
> There are more questions to follow to get this working I'm sure, but
> i'll leave it there to see whether anybody has done this successfully
> or not.
>
> Many thanks
> Will
>
> --- In firebird-php@yahoogroups.com, Lester Caine <lester@> wrote:
> >
> > willogibbo wrote:
> >
> > > I hope this doesn't seem too lazy, but I was wondering if anybody
> > > knows of any existing Firebird database based, php session handling
> > > functions i.e. sessionOpen, sessionClose, sessionRead etc..
> > >
> > > There seem to be a number of mySQL based ones around, but I
wonder if
> > > there are any public ones written specifically for Firebird?
> >
> > ADOdb has it built in so I've never looked ;)
> >
> > --
> > Lester Caine
> > -----------------------------
> > L.S.Caine Electronic Services
> > Treasurer - Firebird Foundation Inc.
> >
>