May 12, 2015

How To Destroying OR Unset Session in PHP?

When you used multiple session with different name and If you want any one session destroy OR unset then used following syntax:

<?php
session_start();
unset($_SESSION['session_name']);
?>

And If you want destroy all session name and data after success process then used following syntax:

<?php
session_start();
session_destroy();
?>

Enjoy!

No comments:

Post a Comment