2014-12-18 09:25:33 +01:00
|
|
|
.. _-cookie-:
|
|
|
|
|
|
|
|
|
|
cookie
|
|
|
|
|
======
|
|
|
|
|
|
|
|
|
|
Extracts a cookie with a given name from a request or otherwise rejects the request with a ``MissingCookieRejection`` if
|
|
|
|
|
the cookie is missing.
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-05-11 23:05:18 +02:00
|
|
|
.. includecode2:: /../../akka-http-scala/src/main/scala/akka/http/scaladsl/server/directives/CookieDirectives.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
:snippet: cookie
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
Use the :ref:`-optionalCookie-` directive instead if you want to support missing cookies in your inner route.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
-------
|
|
|
|
|
|
2015-05-11 23:05:18 +02:00
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/CookieDirectivesExamplesSpec.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
:snippet: cookie
|