Class CookieSessionIdExtractor<A extends ExchangeContext,B extends Exchange<A>>

java.lang.Object
io.inverno.mod.session.http.CookieSessionIdExtractor<A,B>
Type Parameters:
A - the exchange context type
B - the exchange type
All Implemented Interfaces:
SessionIdExtractor<A,B>

public class CookieSessionIdExtractor<A extends ExchangeContext,B extends Exchange<A>> extends Object implements SessionIdExtractor<A,B>

A session identifier extractor that extracts the identifier from a request cookie.

Since:
1.13
Author:
Jeremy Kuhn
  • Field Details

  • Constructor Details

    • CookieSessionIdExtractor

      public CookieSessionIdExtractor()

      Creates a cookie session identifier extractor with the default session cookie name.

    • CookieSessionIdExtractor

      public CookieSessionIdExtractor(String sessionCookie)

      Creates a cookie session identifier extractor with the specified session cookie name.

      Parameters:
      sessionCookie - the session cookie name
  • Method Details

    • getSessionCookie

      public String getSessionCookie()

      Returns the session cookie name.

      Returns:
      the session cookie name
    • extract

      public Mono<String> extract(B exchange)
      Description copied from interface: SessionIdExtractor

      Extracts the session identifier from the specified exchange.

      Specified by:
      extract in interface SessionIdExtractor<A extends ExchangeContext,B extends Exchange<A>>
      Parameters:
      exchange - the exchange
      Returns:
      a mono emitting the session identifier or an empty mono if the exchange didn't provide any session identifier