public class CookieUtil extends Object
DefaultOAuth2AuthorizedClientRepository
and
BroadleafAuthorizationRequestRepository
Modifier and Type | Method and Description |
---|---|
static javax.servlet.http.Cookie |
createCookie(String cookieName,
String content,
int maxAge)
Deprecated.
since 1.6, replaced by
createResponseCookie(String, String, int, String) |
static javax.servlet.http.Cookie |
createDeleteCookie(String cookieName)
Deprecated.
since 1.6, replaced by
createSessionRemovalResponseCookie(String, String) |
static org.springframework.http.ResponseCookie |
createResponseCookie(String cookieName,
String content,
int maxAge,
String sameSite)
Creates an HTTP-only, secure cookie with the given name, content, maxAge, and SameSite
attributes.
|
static javax.servlet.http.Cookie |
createSessionCookie(String cookieName,
String content)
Deprecated.
since 1.6, replaced by
createSessionResponseCookie(String, String, String) |
static org.springframework.http.ResponseCookie |
createSessionRemovalResponseCookie(String cookieName,
String sameSite)
Creates a cookie which will cause deletion of a previously set cookie.
|
static org.springframework.http.ResponseCookie |
createSessionResponseCookie(String cookieName,
String content,
String sameSite)
Creates a cookie with attributes appropriate for a session cookie.
|
static String |
getCookieValue(String name,
javax.servlet.http.HttpServletRequest request) |
public static String getCookieValue(String name, javax.servlet.http.HttpServletRequest request)
@Deprecated public static javax.servlet.http.Cookie createSessionCookie(String cookieName, String content)
createSessionResponseCookie(String, String, String)
cookieName
- the name of the cookie to createcontent
- the value of the cookie@Deprecated public static javax.servlet.http.Cookie createDeleteCookie(String cookieName)
createSessionRemovalResponseCookie(String, String)
cookieName
- the name of the cookie@NonNull @Deprecated public static javax.servlet.http.Cookie createCookie(String cookieName, String content, int maxAge)
createResponseCookie(String, String, int, String)
cookieName
- the name of the cookie to createcontent
- the cookie valuemaxAge
- the max age for the cookiepublic static org.springframework.http.ResponseCookie createSessionResponseCookie(String cookieName, String content, String sameSite)
cookieName
- the name of the cookie to createcontent
- the value of the cookiesameSite
- the SameSite attribute value for the cookie, ex: 'Lax', 'Strict', 'None'createResponseCookie(String, String, int, String)
public static org.springframework.http.ResponseCookie createSessionRemovalResponseCookie(String cookieName, String sameSite)
cookieName
- the name of the cookiesameSite
- the SameSite attribute value for the cookie, ex: 'Lax', 'Strict', 'None'createResponseCookie(String, String, int, String)
public static org.springframework.http.ResponseCookie createResponseCookie(String cookieName, String content, int maxAge, @Nullable String sameSite)
cookieName
- the name of the cookie to createcontent
- the cookie valuemaxAge
- the max age for the cookiesameSite
- the SameSite attribute value for the cookie, ex: 'Lax', 'Strict', 'None'Copyright © 2021. All rights reserved.