# \vendor\topthink\framework\src\think\session\driver\File.php
public function __construct(App $app, array $config = [])
{
$this->config = array_merge($this->config, $config);
if (empty($this->config['path'])) {
$this->config['path'] = $app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'session' . DIRECTORY_SEPARATOR;
} elseif (substr($this->config['path'], -1) != DIRECTORY_SEPARATOR) {
$this->config['path'] .= DIRECTORY_SEPARATOR;
}
$this->init();
}才知道session需要配置path才可以(session配置中也没提起此参数),问题是这里不应该调用getRuntimePath()方法么? 最佳答案