Forum : How to Destroy a Session?
Brief description  about Online courses   join in Online courses
View prabeen  patra 's Profile

How to Destroy a Session?

How to Destroy a Session?
Asked by prabeen patra | Mar 17, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Prabeen,
If you wish to delete some session data, you can use the unset() or the session_destroy() function.
The unset() function is used to free the specified session variable:
<?php
unset($_SESSION['views']);
?>
You can also completely destroy the session by calling the session_destroy() function:
<?php
session_destroy();
?>
Note: session_destroy() will reset your session and you will lose all your stored session data.
Mar 17, 2010