Re: Re: Custom session save handler. What's happens really?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, but I serialize and unserialize the objects and this is not my
problem...(I known best practices for php5 about object serialization).

Please read again the post.

Selon itoctopus <newsgroup@xxxxxxxxxxxxx>:

> You have to explicitly serialize and unserialize the objects.
> I think the confusion here is with the automatic __wakeup and __sleep
> functions:
>
http://www.devshed.com/c/a/PHP/Using-the-Sleep-and-Wakeup-Functions-to-Serialize-Objects-in-PHP/
>
>
> --
> itoctopus - http://www.itoctopus.com
> <n.quirin@xxxxxxx> wrote in message
> news:1178263604.463ae03437fd5@xxxxxxxxxxxxxx
> > Hi,
> >
> > i'm using in each script:
> >
> > <?
> > session_set_save_handler(...); //register my custom function to store
> > session
> > //into a mysql database
> >
> > session_start(); //session.auto_start is set to 0 in php.ini
> > register_shutdown("session_write_close");
> >
> > $object = unserialize($_SESSION['objectname']);
> > //modify the object
> > //....
> > $_SESSION['objectname'] = serialize($object);
> > ?>
> >
> > When are exactly called the write and read function of my custom handler?
> > Is it at the session_start that read function is called?
> > or is it at $object = unserialize($_SESSION['objectname'])?
> >
> > Is write function called at session_write_close only?
> > or any time $_SESSION[] is writted?
> >
> > Thanks a lot, I have no clue from PHP tutorial about this...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux