[thelist] RE: in-principle, PHP/mySQL shopping basket question
Hassan Schroeder
hassan at webtuitive.com
Wed Jul 23 16:56:21 CDT 2003
SBeam wrote:
> yes you can define user-level functions to handle the sessions; you can
> therefore store in DB, shared memory, write to log, send to your palm pilot,
> whatever.
> http://us2.php.net/manual/en/function.session-set-save-handler.php
This doesn't seem to be exactly the same, but tell me if I'm wrong;
someone's asking me to help with their PHP-driven site, so I need
to learn more about PHP :-)
In my servlet container, I've got a class ShoppingCart defined as:
public class ShoppingCart implements HttpSessionBindingListener{...}
The cart does the usual cart stuff, removing things from inventory
as they're added to the cart, etc., but the last part of that means
it's registered to get a notification of an HttpSessionBindingEvent.
So if the session times out, the method
public void valueUnbound( HttpSessionBindingEvent event ){...}
is called, and the code within it executed -- stuff in cart returned
to inventory DB, etc.
So I guess my question is -- does PHP have its own intrinsic session
management to generate events, and are there listeners to act on them?
TIA,
--
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
More information about the thelist
mailing list