[phplib] Session IV From: Ulf Wendel (uw <email protected>)
Date: 05/30/01

"Session IV ... the never ending story" or "Battlefight against cookies"

Hi everybody,

two days ago one of my workmates that's currently working on a pretty
cool and middle sized (7k loc) IP number administration tool got a phone
call from his customer: "Cookies? No, we've changed our mind, must work
without as well". Uff, damn. There was no chance to go through all of
the 7000 lines and manually rewrite the urls. The best solution that
came into our mind was using trans-sid.

Ok, I then looked in the CVS and found 3 session4.* implementations.
None of them looked perfect and the directory structure of the CVS was
in a mess. No matter how good the submited material was/is I couldn't
make up my mind wich one to use. Of course everybody suggested their own
solution. I wasn't very much satisfied with this situation and I decided
to "crash" the CVS as it could not get more confusing in my eyes.

After a short discussion with my colleague Matthias the plan was born to
merge the n files into as few as possible and name them [...]4.inc as
Kristian suggested with the last CVS commits he did. Here's what
happened to session. We now have two files for PHPLib Sessions using the
PHP 4 build-in functions:

 session4.inc Session
                              |
                              v
 session4_custom.inc Session_Custom

The class Session is a more or less straight forward wrapper around the
PHP 4 session functions with default configuration. Don't worry the
interface of the class remained the same so that you should have no
problem switching to it. If you'd like to continue to use the PHPLib
CT_* Container you can use Session_Custom. Set the member variable
"mode" to "user" to indicate that you don't want to use one of the other
options "file" or "mm" - PHP 4 build-in's.

I personally had not problems yet with transparently switching to the
new classes. Suddenly the application worked with GET parameters
automatically applied to all URLs when cookies were disabled. While I'm
writing these lines I see Maxim committing very first fixes and minor
changes, so that I'm confident of a stable version in near future.

What else happend:

  - moved php/phplib-4 to unsupp/phplib-4

    Please merge and add cleaned up [...]4.inc
    files to the php/ directory - please don't misunderstand
    me for putting it into "unsupported". All I want is a clear
    and consistent CVS structure.

  - streamlined Maxim's user4.inc
    
    Maxim introduced a new global Hash named
    PHPLIB_USER_VARS similar to the PHP 4 variable
    HTTP_SESSION_VARS.
    
    Only the public part of the API remained the same,
    if you're a bad boy using private or some other marked
    with "do not"...

  - added local4.inc

Anyway, I did not clean up the CVS properly, I did only half of the job.
Can someone else do the rest - thanks!

Does this commit mean, that NetUSE continues the work on the PHPLib? No,
it does not. We'll do some maintaining from time to time whenever we
need, but that's all.

It's quite similiar with my form* commits. I'll finish the work started
ages ago in the PHPLib CVS but then offer the code for PEAR.

... thank god (can such a young guy be called a god?) for trans-sid ;)
Ulf

-- 
NetUSE AG              Dr.-Hell-Straße   Fon: +49 431 386 436 00 
http://www.netuse.de/  D-24107 Kiel      Fax: +49 431 386 435 99

PHP lernen? Noch sind Schulungsplätze frei: http://www.netuse.de/

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>