public static class Http.Cookie
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Http.Cookie.SameSite
The cookie SameSite attribute
|
Constructor and Description |
---|
Cookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge,
java.lang.String path,
java.lang.String domain,
boolean secure,
boolean httpOnly)
Deprecated.
as of 2.6.0. Use
builder(java.lang.String, java.lang.String) . |
Cookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge,
java.lang.String path,
java.lang.String domain,
boolean secure,
boolean httpOnly,
Http.Cookie.SameSite sameSite)
Construct a new cookie.
|
Modifier and Type | Method and Description |
---|---|
play.api.mvc.Cookie |
asScala() |
static Http.CookieBuilder |
builder(java.lang.String name,
java.lang.String value) |
java.lang.String |
domain() |
boolean |
httpOnly() |
java.lang.Integer |
maxAge() |
java.lang.String |
name() |
java.lang.String |
path() |
java.util.Optional<Http.Cookie.SameSite> |
sameSite() |
boolean |
secure() |
java.lang.String |
value() |
public Cookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge, java.lang.String path, java.lang.String domain, boolean secure, boolean httpOnly, Http.Cookie.SameSite sameSite)
builder(java.lang.String, java.lang.String)
for creating new cookies in your
application.name
- Cookie name, must not be nullvalue
- Cookie valuemaxAge
- Cookie duration in seconds (null for a transient cookie, 0 or less for one that
expires now)path
- Cookie pathdomain
- Cookie domainsecure
- Whether the cookie is secured (for HTTPS requests)httpOnly
- Whether the cookie is HTTP only (i.e. not accessible from client-side
JavaScript code)sameSite
- the SameSite attribute for this cookie (for CSRF protection).@Deprecated public Cookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge, java.lang.String path, java.lang.String domain, boolean secure, boolean httpOnly)
builder(java.lang.String, java.lang.String)
.name
- Cookie name, must not be nullvalue
- Cookie valuemaxAge
- Cookie duration in seconds (null for a transient cookie, 0 or less for one that
expires now)path
- Cookie pathdomain
- Cookie domainsecure
- Whether the cookie is secured (for HTTPS requests)httpOnly
- Whether the cookie is HTTP only (i.e. not accessible from client-side
JavaScript code)public static Http.CookieBuilder builder(java.lang.String name, java.lang.String value)
name
- the cookie builder namevalue
- the cookie builder valuepublic java.lang.String name()
public java.lang.String value()
public java.lang.Integer maxAge()
public java.lang.String path()
public java.lang.String domain()
public boolean secure()
public boolean httpOnly()
public java.util.Optional<Http.Cookie.SameSite> sameSite()
public play.api.mvc.Cookie asScala()