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

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

 



On Fri, May 4, 2007 2:26 am, n.quirin@xxxxxxx wrote:
> 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?

Probably.

> or is it at $object = unserialize($_SESSION['objectname'])?

Possibly.

Use http://php.net/error_log with a timestamp and find out...

> Is write function called at session_write_close only?

Almost for sure.

> or any time $_SESSION[] is writted?

That would be HORRIBLE performance, so probably NOT.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
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