Hello friends, I am having a confusion in my script please explain me what is it doing i don't know what it is i don't understand sessions very well, so please explain it

if (isset($_SESSION['SBUser'])) {
    $user_id =*** $_SESSION['SBUser']***;
    $query = $db->query("SELECT * FROM users WHERE id = '$user_id'");
    $user_data = mysqli_fetch_assoc($query);
    $fn =  explode(' ', $user_data['full_name']);
    $user_data['first'] = $fn['0'];
    $user_data['last'] = $fn['1'];


$_SESSION['SBUser']; please explain me what does it mean.

$_SESSION is a collection of values stored on the web server per visitor, per browser (ie, tied to the browser by a *cookie* that stores a unique *Session ID*.)

Values can be stored in $_SESSION for retrieval on the server in your PHP code in subsequent requests.

Your code snippet checks to see if the $_SESSION['SBUser'] has already been set. If so, retrieve user details from the database.