Annotation Type UnencryptedCookiePreview


  • @Retention(RUNTIME)
    @Target(PARAMETER)
    public @interface UnencryptedCookiePreview
    This is a preview version of @UnencryptedCookie, which supports cookies with the Same-Site attribute set

    Maps the parameter to the specified HTTP request cookie, URL decoding and converting the type if necessary. If the session parameter is missing, aborts the request with 401 Unauthorized, unless the parameter type is Optional. If the parameter type is Consumer, calling parameter.accept() sets the cookie value instead of returning it converting the type and URL encoding.

    See Also:
    HttpParameterMapping
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      The name of the cookie
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String comment
      If set, sets the Comment attribute on the cookie
      boolean isHttpOnly
      If false, omits the HttpOnly flag on the cookie, meaning that the cookie can be read by client-side JavaScript.
      UnencryptedCookiePreview.SameSite sameSite
      If set, sets the SameSite attribute on the cookie.
      boolean secure
      If false, omits the Secure flag on the cookie, meaning that the cookie will be sent over HTTP as well as HTTPS.
    • Element Detail

      • value

        String value
        The name of the cookie
      • secure

        boolean secure
        If false, omits the Secure flag on the cookie, meaning that the cookie will be sent over HTTP as well as HTTPS. For testing purposes, action-controller always omits the Secure flag for localhost addresses
        Default:
        true
      • isHttpOnly

        boolean isHttpOnly
        If false, omits the HttpOnly flag on the cookie, meaning that the cookie can be read by client-side JavaScript. You normally want HttpOnly to mitigate the impact of Cross-site Scripting attacks
        Default:
        true
      • sameSite

        UnencryptedCookiePreview.SameSite sameSite
        If set, sets the SameSite attribute on the cookie. Legal values are: Strict (never send the cookie to other hosts), Lax (send the cookie to other sites with the same domain, even if the subdomain and port differ), None (send the cookie to all sites)
        Default:
        org.actioncontroller.values.UnencryptedCookiePreview.SameSite.NotSet
      • comment

        String comment
        If set, sets the Comment attribute on the cookie
        Default:
        ""