public class CookieBuilder extends Object
| Constructor and Description |
|---|
CookieBuilder() |
| Modifier and Type | Method and Description |
|---|---|
io.undertow.server.handlers.Cookie |
build() |
static CookieBuilder |
create() |
CookieBuilder |
discard(boolean discard)
Sets discarding of the cookie
Default is false
|
CookieBuilder |
domain(String domain)
Sets the domain of the cookie
Default is null
|
CookieBuilder |
expires(LocalDateTime expires)
Sets the date when the cookie expires
Default is now plus 1 day
|
CookieBuilder |
httpOnly(boolean httpOnly)
Sets if the cookie can only be used of HTTP
connections
Default is false
|
CookieBuilder |
maxAge(Integer maxAge)
Sets the max age of the cookie
Default value is null
|
CookieBuilder |
name(String name)
Sets the name of the cookie
Default is ""
|
CookieBuilder |
path(String path)
Sets the path of the cookie
Default is /
|
CookieBuilder |
secure(boolean secure)
Sets if the cookie can only be used of HTTPS
connections
Default is false
|
CookieBuilder |
value(String value)
Sets the value of the cookie
Default is ""
|
public static CookieBuilder create()
public CookieBuilder name(String name)
name - The name of the cookiepublic CookieBuilder value(String value)
value - The value of the cookiepublic CookieBuilder path(String path)
path - The path of the cookiepublic CookieBuilder expires(LocalDateTime expires)
expires - The expires LocalDateTimepublic CookieBuilder maxAge(Integer maxAge)
maxAge - The max age of the cookiepublic CookieBuilder domain(String domain)
domain - The domain of the cookiepublic CookieBuilder discard(boolean discard)
discard - True if cookie should be discard, false otherwisepublic CookieBuilder secure(boolean secure)
secure - True if the cookie can only be used via HTTPS, false otherwisepublic CookieBuilder httpOnly(boolean httpOnly)
httpOnly - True if the cookie can only be send via HTTP, false otherwisepublic io.undertow.server.handlers.Cookie build()
Copyright © 2016. All rights reserved.