Skip to content

Commit cd61c4c

Browse files
committed
fix: $expire type in set_cookie()
It should be int.
1 parent 365e4c1 commit cd61c4c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

system/HTTP/ResponseInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public function sendBody();
322322
*
323323
* @param array|string $name Cookie name or array containing binds
324324
* @param string $value Cookie value
325-
* @param string $expire Cookie expiration time in seconds
325+
* @param int $expire Cookie expiration time in seconds
326326
* @param string $domain Cookie domain (e.g.: '.yourdomain.com')
327327
* @param string $path Cookie path (default: '/')
328328
* @param string $prefix Cookie name prefix
@@ -335,7 +335,7 @@ public function sendBody();
335335
public function setCookie(
336336
$name,
337337
$value = '',
338-
$expire = '',
338+
$expire = 0,
339339
$domain = '',
340340
$path = '/',
341341
$prefix = '',

system/HTTP/ResponseTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public function redirect(string $uri, string $method = 'auto', ?int $code = null
554554
*
555555
* @param array|Cookie|string $name Cookie name / array containing binds / Cookie object
556556
* @param string $value Cookie value
557-
* @param string $expire Cookie expiration time in seconds
557+
* @param int $expire Cookie expiration time in seconds
558558
* @param string $domain Cookie domain (e.g.: '.yourdomain.com')
559559
* @param string $path Cookie path (default: '/')
560560
* @param string $prefix Cookie name prefix ('': the default prefix)
@@ -567,7 +567,7 @@ public function redirect(string $uri, string $method = 'auto', ?int $code = null
567567
public function setCookie(
568568
$name,
569569
$value = '',
570-
$expire = '',
570+
$expire = 0,
571571
$domain = '',
572572
$path = '/',
573573
$prefix = '',
@@ -700,7 +700,7 @@ public function deleteCookie(string $name = '', string $domain = '', string $pat
700700
}
701701

702702
if (! $found) {
703-
$this->setCookie($name, '', '', $domain, $path, $prefix);
703+
$this->setCookie($name, '', 0, $domain, $path, $prefix);
704704
}
705705

706706
return $this;

system/Helpers/cookie_helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @param array|Cookie|string $name Cookie name / array containing binds / Cookie object
2828
* @param string $value The value of the cookie
29-
* @param string $expire The number of seconds until expiration
29+
* @param int $expire The number of seconds until expiration
3030
* @param string $domain For site-wide cookie. Usually: .yourdomain.com
3131
* @param string $path The cookie path
3232
* @param string $prefix The cookie prefix ('': the default prefix)
@@ -41,7 +41,7 @@
4141
function set_cookie(
4242
$name,
4343
string $value = '',
44-
string $expire = '',
44+
int $expire = 0,
4545
string $domain = '',
4646
string $path = '/',
4747
string $prefix = '',

0 commit comments

Comments
 (0)