Home > Archive > PHP Language > September 2005 > Custom session 'destroy' handler
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Custom session 'destroy' handler
|
|
|
| Hello all,
I like to execute some code when a session is destoyed. I do the fololwing:
// Custom session 'destroy' handler
function session_destroy($session_id) {
$return=true;
include_once 'session_destroy.php';
return $return;
}
session_set_save_handler('','','','','se
ssion_destroy','');
session_start();
I receive the following error:
session_set_save_handler(): Argument 1 is not a valid callback in ....
Does this means that I have to define all other handler functions as well? I
am satisfied with the default handlers. Can't I overwrite just one handler?
Thanks Rob
| |
| Oli Filth 2005-09-29, 6:56 pm |
| Rob said the following on 29/09/2005 12:06:
> Hello all,
>
> I like to execute some code when a session is destoyed. I do the fololwing:
>
> // Custom session 'destroy' handler
> function session_destroy($session_id) {
> $return=true;
> include_once 'session_destroy.php';
> return $return;
> }
> session_set_save_handler('','','','','se
ssion_destroy','');
> session_start();
>
> I receive the following error:
> session_set_save_handler(): Argument 1 is not a valid callback in ....
>
> Does this means that I have to define all other handler functions as well?
I don't know, but I do know that you can't have a function called
session_destroy(), because one already exists!
--
Oli
|
|
|
|
|