Modifier and Type | Class and Description |
---|---|
static class |
Http.Cookie.SameSite
The cookie SameSite attribute
|
Constructor and Description |
---|
Cookie(String name,
String value,
Integer maxAge,
String path,
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(String name,
String value) |
String |
domain() |
boolean |
httpOnly() |
Integer |
maxAge() |
String |
name() |
String |
path() |
Optional<Http.Cookie.SameSite> |
sameSite() |
boolean |
secure() |
String |
value() |
public Cookie(String name, String value, Integer maxAge, String path, 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).public static Http.CookieBuilder builder(String name, String value)
name
- the cookie builder namevalue
- the cookie builder valuepublic String name()
public String value()
public Integer maxAge()
public String path()
public String domain()
public boolean secure()
public boolean httpOnly()
public Optional<Http.Cookie.SameSite> sameSite()
public play.api.mvc.Cookie asScala()