The unset() function is used to unset or free a session variable that has been set. A session can be completely destroyed by using the session_destroy() function.
Example code:
All the stored data of the session will be deleted on calling the session_destroy() function.
Example code: