Re: [PHP4BETA] session_set_save_handler
| From: | Andreas Pour | Date: | Wed, 01 Mar 2000 01:57:48 +0000 |
| Subject: | Re: [PHP4BETA] session_set_save_handler | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11227@lists.php.net to get a copy of this message | ||
Hi,
Use 'register_shutdown_function("my_func")'. This function will be
called at each shutdown. Thus you need to keep track if this function
has been called before. Two functions which might help you is
connection_aborted(), which returns true if the function was called b/c
of a user abort, and connection_timeout(), which tells you if the timer
was exceeded.
Ciao,
Andreas
Peter Kocks wrote:
>
> Hi,
>
> I'd like to register a function to be called whenever a session is destroyed
> or when the max lifetime is exceeded. Basically, there is some cleanup I'd
> like to do that is not directly related to the session functions. I see
> there is a function:
>
> session_set_save_handler ("open", "close", "read",
> "write", "destroy",
> "gc");
>
> But, what I really want is some type of callback within the regular destroy
> function so that I can do some cleanup. Is there anyway to do this? A
> register_shutdown() for sessions?
>
> Thanks
>
> --pk
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net