PHP

Topic: Sessions

How To Remove Values Saved in the Current Session?

If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION:    unset($_SESSION['MyColor']) - Removes one value named MyColor in the current session.    $_SESSION = array() - Removes all values in the current session.    unset($_SESSION) - Bad statement. It may affect the session mechanism.

Browse random answers: