How to avoid obsolescence warning by replacing session_unregister with $ SESSION [] after upgrading to PHP 5.3?

I just installed PHP 5.3 and canceled the following outdated warnings .

It says in: session_unregister() is deprecated

session_unregister($serverWideUniqueIdCode);

and the replacement seems to be $ _SESSION [].

So, what is the syntax with $_SESSION[]expressing the same thing?

+3
source share
2 answers

Quote document (look at this page, it says some pretty interesting stuff ;-)):

session_unregister () unregisters a global variable named name from the current session.

, unset. ,

session_unregister('my_var');

unset($_SESSION['my_var']);

, , , :

unset($_SESSION[$serverWideUniqueIdCode]);


, , , unset $_SESSION. :

. $_SESSION ( $HTTP_SESSION_VARS PHP 4.0.6 ), unset() . unset() $_SESSION, $_SESSION .

+12

$_ SESSION = array();

+2

Source: https://habr.com/ru/post/1714686/