8000 Update http_foundation.rst · symfony/symfony-docs@86fa70b · GitHub
[go: up one dir, main page]

Skip to content

Commit 86fa70b

Browse files
authored
Update http_foundation.rst
1 parent fefc2f2 commit 86fa70b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/http_foundation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,14 @@ method takes an instance of
377377
You can clear a cookie via the
378378
:method:`Symfony\\Component\\HttpFoundation\\ResponseHeaderBag::clearCookie` method.
379379

380+
You can also create a
381+
:class:`Symfony\\Component\\HttpFoundation\\Cookie` object from a raw header value using :method:`Symfony\Component\HttpFoundation\Cookie::fromString`.
382+
383+
.. tip::
384+
385+
You can directly send the cookie from a string using
386+
``$response->headers->set('set-cookie', 'key=value; secure', $replace)``.
387+
380388
Managing the HTTP Cache
381389
~~~~~~~~~~~~~~~~~~~~~~~
382390

0 commit comments

Comments
 (0)
0