* Add httpOnly param when setcookie.

This commit is contained in:
guanxiying
2019-11-21 13:31:35 +08:00
parent 230dcd7dd7
commit 4e481bed19
+3 -3
View File
@@ -867,7 +867,7 @@ class baseRouter
$this->clientLang = $this->config->default->lang;
}
setcookie('lang', $this->clientLang, $this->config->cookieLife, $this->config->webRoot);
setcookie('lang', $this->clientLang, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if(!isset($_COOKIE['lang'])) $_COOKIE['lang'] = $this->clientLang;
return true;
@@ -921,7 +921,7 @@ class baseRouter
$this->clientTheme = $this->config->default->theme;
}
setcookie('theme', $this->clientTheme, $this->config->cookieLife, $this->config->webRoot);
setcookie('theme', $this->clientTheme, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = $this->clientTheme;
return true;
@@ -947,7 +947,7 @@ class baseRouter
$this->clientDevice = ($mobile->isMobile() and !$mobile->isTablet()) ? 'mobile' : 'desktop';
}
setcookie('device', $this->clientDevice, $this->config->cookieLife, $this->config->webRoot);
setcookie('device', $this->clientDevice, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if(!isset($_COOKIE['device'])) $_COOKIE['device'] = $this->clientDevice;
return $this->clientDevice;