Class CookieHttpSessionIdGenerator

java.lang.Object
io.micronaut.session.http.CookieHttpSessionIdGenerator

@Singleton @Requires(property="micronaut.session.http.cookie", notEquals="false") public class CookieHttpSessionIdGenerator extends Object
Utility to generate a session id from a cookie value or builds a cookie value from session.
Since:
1.0.1
Author:
Sergio del Amo
  • Constructor Details

    • CookieHttpSessionIdGenerator

      public CookieHttpSessionIdGenerator(HttpSessionConfiguration configuration)
      Constructor.
      Parameters:
      configuration - The HTTP session configuration
  • Method Details

    • isBase64Decode

      public boolean isBase64Decode()
      Returns:
      Whether the Base64 encode sessions IDs sent back to clients
    • getPrefix

      public String getPrefix()
      Returns:
      The prefix to use when serializing session ID
    • sessionIdFromCookie

      @NonNull public @NonNull String sessionIdFromCookie(@NonNull @NonNull io.micronaut.http.cookie.Cookie cookie)
      Parameters:
      cookie - A Cookie
      Returns:
      A session id from a cookie value
    • cookieValueFromSession

      @NonNull public @NonNull String cookieValueFromSession(@NonNull @NonNull Session session)
      Parameters:
      session - The session
      Returns:
      Cookie value from session.