改进Input类和Request类的session获取

This commit is contained in:
thinkphp
2016-06-07 17:05:01 +08:00
parent ee7ef63c00
commit 451e7f0dda
3 changed files with 4 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ namespace think;
use think\Config;
use think\Input;
use think\Session;
class Request
{
@@ -632,10 +633,7 @@ class Request
*/
public function session($name = '')
{
if (PHP_SESSION_DISABLED == session_status()) {
session_start();
}
return Input::data($this->session ?: $_SESSION, $name);
return Input::data($this->session ?: Session::get(), $name);
}
/**