Module io.jooby
Package io.jooby

Class SessionToken.CookieID

java.lang.Object
io.jooby.SessionToken.CookieID
All Implemented Interfaces:
SessionToken
Enclosing interface:
SessionToken

public static class SessionToken.CookieID extends Object implements SessionToken
Looks for a session ID from request cookie headers. This strategy:

- find a token from a request cookie. - on save, set a response cookie on new sessions or when cookie has a max-age value. - on destroy, expire the cookie.

  • Constructor Details

    • CookieID

      public CookieID(@NonNull Cookie cookie)
      Creates a Cookie ID.
      Parameters:
      cookie - Cookie to use.
  • Method Details

    • findToken

      @Nullable public String findToken(@NonNull Context ctx)
      Description copied from interface: SessionToken
      Find session ID.
      Specified by:
      findToken in interface SessionToken
      Parameters:
      ctx - Web context.
      Returns:
      Session ID or null.
    • saveToken

      public void saveToken(@NonNull Context ctx, @NonNull String token)
      Description copied from interface: SessionToken
      Save session ID in the web context.
      Specified by:
      saveToken in interface SessionToken
      Parameters:
      ctx - Web context.
      token - Token/data to save.
    • deleteToken

      public void deleteToken(@NonNull Context ctx, @NonNull String token)
      Description copied from interface: SessionToken
      Delete session ID in the web context.
      Specified by:
      deleteToken in interface SessionToken
      Parameters:
      ctx - Web context.
      token - Token/data to delete.