thinkphp6开启session

打开app目录下的middleware.php文件,在return中加上:

\think\middleware\SessionInit::class

925020-20200126151136440-2053221736.png