dflydev / dflydev-fig-cookies

Cookies for PSR-7 HTTP Message Interface.
MIT License
224 stars 29 forks source link

`FigRequestCookies::get()` not using `ServerRequesInterface::getCookieParams()` ? #57

Open drupol opened 1 year ago

drupol commented 1 year ago

Hello,

I'm trying to understand how FigRequestCookies::get() works. By looking at the code, I noticed that it is not using ServerRequesInterface::getCookieParams() .

Is there anyone who could explain that?

Basically, what are the differences between:

$cookie = FigRequestCookies::get($request, 'foo');

vs

$cookie = $request->getCookieParams()['foo'];

Thank you.