I need to destroy a session when user leave from a particular page. I use session_destroy() on the end of the page but its not feasible for me because my page h
session_destroy()
For a particular page you need to destroy the session, then unset the all session variable using
unset($_SESSION['varname']);
For the whole site you can use session_destroy();
session_destroy();