I just want to find out when and why we should use session_register_shutdown(). please don't copy descriptions from php.net. Thanks
A shutdown function is the equivalent of a destructor for code that is not object-oriented.
You can register a shutdown function if you want something to be executed if a certain component is no longer needed and you want to take an action, e.g. some sort of clean-up.
The session shutdown function is called when the session is destroyed, giving you the opportunity to perform a final action with the session before it isn't available anymore (e.g. you could extract parameters from the $_SESSION
variable).
Usually, you will not need to use this function.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments