The meaning of Session scope

if you use ThinkPHP as a project, you can"t understand the meaning of Session scope.
Why do you set this to work on the server? isn"t session invoked on the server?

https://www.kancloud.cn/manua...

May.08,2022

look at the source code

/**
 * session
 * @access public
 * @param  string        $name session
 * @param  mixed         $value session
 * @param  string|null   $prefix 
 * @return void
 */
public function set($name, $value, $prefix = null)
{
    $this->lock();
    empty($this->init) && $this->boot();
    $prefix = !is_null($prefix) ? $prefix : $this->prefix;
    if (strpos($name, '.')) {
        // 
        list($name1, $name2) = explode('.', $name);
        if ($prefix) {
            $_SESSION[$prefix][$name1][$name2] = $value;
        } else {
            $_SESSION[$name1][$name2] = $value;
        }
    } elseif ($prefix) {
        $_SESSION[$prefix][$name] = $value;
    } else {
        $_SESSION[$name] = $value;
    }
    $this->unlock();
}

you can see from $_ SESSION [$prefix] [$name] = $value; that the purpose of scope is to add an extra layer

Session.php

for use in multiple modules

// 
Session::set('login_user', 'xxxx', 'admin');
// 
Session::set('login_user', 'xxx', 'some');
Menu