Remove unnecessary parameters

This commit is contained in:
Franz Liedke 2016-12-28 22:51:03 +01:00
parent 27b9c169fa
commit 4c66759c40

View File

@ -35,29 +35,21 @@ class CookieFactory
* @param string $name
* @param string $value
* @param int $maxAge
* @param string $path
* @param bool $secure
* @param bool $httpOnly
* @param string $domain
* @return \Dflydev\FigCookies\SetCookie
*/
public function make($name, $value = null, $maxAge = null, $path = null, $secure = null, $httpOnly = true, $domain = null)
public function make($name, $value = null, $maxAge = null)
{
$url = parse_url(rtrim($this->app->url(), '/'));
if ($path === null) {
$path = array_get($url, 'path') ?: '/';
}
$path = array_get($url, 'path') ?: '/';
if ($secure === null && array_get($url, 'scheme') === 'https') {
$secure = true;
}
$secure = array_get($url, 'scheme') === 'https';
return SetCookie::create($name, $value)
->withMaxAge($maxAge)
->withPath($path)
->withSecure($secure)
->withHttpOnly($httpOnly)
->withDomain($domain);
->withHttpOnly(true)
->withDomain(null);
}
}