I only want to unset play_mode however the second line also unsets landing_site.
Why is this happening?
session_start();
session_unset($_SESSION['play_mode']);
echo $_SESSION['landing_site'];
I only want to unset play_mode however the second line also unsets landing_site.
Why is this happening?
session_start();
session_unset($_SESSION['play_mode']);
echo $_SESSION['landing_site'];
Because, as per the documentation,
The session_unset() function frees all session variables currently registered.
Also, session_unset()
takes no arguments.
If you only want to unset $_SESSION['play_mode']
, then just do unset($_SESSION['play_mode'])
.