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

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...