@@ -80,14 +80,15 @@ public function header($key, $value, $ucwords = null)
8080 }
8181
8282 /**
83- * @param string $name
84- * @param string $value
85- * @param int|string $expires
86- * @param string|null $path
87- * @param string $domain
88- * @param bool $secure
89- * @param bool $httpOnly
90- * @param null $samesite
83+ * @param string $name
84+ * @param string|null $value
85+ * @param int|string|null $expires
86+ * @param string|null $path
87+ * @param string|null $domain
88+ * @param bool|null $secure
89+ * @param bool|null $httpOnly
90+ * @param string|null $samesite
91+ * @param string|null $priority
9192 */
9293 public function cookie (
9394 $ name ,
@@ -97,7 +98,8 @@ public function cookie(
9798 $ domain = null ,
9899 $ secure = null ,
99100 $ httpOnly = null ,
100- $ samesite = null
101+ $ samesite = null ,
102+ $ priority = null
101103 ) {
102104 $ result = \urlencode ($ name ) . '= ' . \urlencode ($ value );
103105
@@ -117,22 +119,26 @@ public function cookie(
117119 }
118120
119121 if ($ timestamp !== 0 ) {
120- $ result .= '; expires = ' . \gmdate ('D, d-M-Y H:i:s e ' , $ timestamp );
122+ $ result .= '; Expires = ' . \gmdate ('D, d-M-Y H:i:s e ' , $ timestamp );
121123 }
122124 }
123125
124126 if ($ secure ) {
125- $ result .= '; secure ' ;
127+ $ result .= '; Secure ' ;
126128 }
127129
128- // if ($hostOnly) {
129- // $result .= '; HostOnly';
130- // }
131-
132130 if ($ httpOnly ) {
133131 $ result .= '; HttpOnly ' ;
134132 }
135133
134+ if ($ samesite ) {
135+ $ result .= '; SameSite= ' . $ samesite ;
136+ }
137+
138+ if ($ priority ) {
139+ $ result .= '; Priority= ' . $ priority ;
140+ }
141+
136142 $ this ->cookie [$ name ] = $ result ;
137143 }
138144
0 commit comments