PHP Code Function to Unset Multiple Session Variables

To Unset Multiple Session Variables in a Function in PHP, Add a Related Tag to Session Variables.

Home Short:

For Example if you are setting SESSION variables on a log in page, create session variables like $_SESSION["login-firstname"], $_SESSION["login-lastname"], $_SESSION["login-age"]. Then to unset them at once using the function below ...

unsetSessionVariablesByTag("login-");

S
H
A
R
E