Interface ApplicationCookieService

All Known Implementing Classes:
StandardApplicationCookieService, StandardCookieCsrfTokenRepository.CsrfApplicationCookieService

public interface ApplicationCookieService
Application Cookie Service capable of generating and retrieving HTTP Cookies using standard properties
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
    Generate cookie with specified value
    void
    addSessionCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
    Generate cookie with session-based expiration and specified value
    getCookieValue(jakarta.servlet.http.HttpServletRequest request, ApplicationCookieName applicationCookieName)
    Get cookie value using specified name
    void
    removeCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName)
    Generate cookie with an empty value instructing the client to remove the cookie
  • Method Details

    • addCookie

      void addCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
      Generate cookie with specified value
      Parameters:
      resourceUri - Resource URI containing path and domain
      response - HTTP Servlet Response
      applicationCookieName - Application Cookie Name to be added
      value - Cookie value to be added
    • addSessionCookie

      void addSessionCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
      Generate cookie with session-based expiration and specified value
      Parameters:
      resourceUri - Resource URI containing path and domain
      response - HTTP Servlet Response
      applicationCookieName - Application Cookie Name
      value - Cookie value to be added
    • getCookieValue

      Optional<String> getCookieValue(jakarta.servlet.http.HttpServletRequest request, ApplicationCookieName applicationCookieName)
      Get cookie value using specified name
      Parameters:
      request - HTTP Servlet Response
      applicationCookieName - Application Cookie Name to be retrieved
      Returns:
      Optional Cookie Value
    • removeCookie

      void removeCookie(URI resourceUri, jakarta.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName)
      Generate cookie with an empty value instructing the client to remove the cookie
      Parameters:
      resourceUri - Resource URI containing path and domain
      response - HTTP Servlet Response
      applicationCookieName - Application Cookie Name to be removed