2014-12-18 09:25:33 +01:00
|
|
|
.. _-optionalCookie-:
|
|
|
|
|
|
|
|
|
|
optionalCookie
|
|
|
|
|
==============
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/CookieDirectives.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
:snippet: optionalCookie
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
2015-10-09 15:19:36 +02:00
|
|
|
Extracts an optional cookie with a given name from a request.
|
2014-12-18 09:25:33 +01:00
|
|
|
|
|
|
|
|
Use the :ref:`-cookie-` directive instead if the inner route does not handle a missing cookie.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: optionalCookie
|