How to destroy PHP session()

To destroy session in PHP you must use session_destroy()

Syntax : bool session_destroy (void)

This method will destroy all the data related to the current session. Note that this will not unset any global variables or session cookies that are associated with the session.


//Session set


$_SESSION['prog'] =  $prog;
$_SESSION['name'] =  $name;

//Destory session


Note: To kill the session completely, the session id must also be unset.

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap