Skip to content

Commit 0cf61ba

Browse files
committed
adds cookie method.
1 parent a623edc commit 0cf61ba

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Mvc/Requests/Request.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function server( string $key, mixed $default = null ): mixed
118118
}
119119

120120
/**
121-
*
121+
* Filtered SESSION parameter
122122
* @param string $key
123123
* @param mixed|null $default
124124
* @return mixed
@@ -128,6 +128,17 @@ public function session( string $key, mixed $default = null ): mixed
128128
return $this->_session->filterScalar( $key, $default );
129129
}
130130

131+
/**
132+
* Filtered COOKIE parameter
133+
* @param string $key
134+
* @param mixed|null $default
135+
* @return mixed
136+
*/
137+
public function cookie( string $key, mixed $default = null ): mixed
138+
{
139+
return $this->_cookie->filterScalar( $key, $default );
140+
}
141+
131142
/**
132143
* @return array
133144
*/

0 commit comments

Comments
 (0)