CLI中的会话是什么?

To my amusement, I understand that one can call session functions in CLI. The way I understand it sessions make sense when the script is running in a response to an HTTP request (e.g. inside a WebServer). Insights ?

You probably want to access a session storage via CLI, and the easiest way is to set the session id, start the session and read from $_SESSION, instead of adding a lot of own code to fetch and parse the serialized data. You won't get the session id via cookie, POST or GET data, though. You have to pass it somehow. Also, you won't benefit from a created cookie when the session is started on CLI.