Module io.jooby
Package io.jooby

Class SessionToken.SignedCookie

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

public static class SessionToken.SignedCookie extends Object implements SessionToken
Looks for a session token from request cookie. This strategy:

- find a token from a request cookie. - on save, set a response cookie. - on destroy, expire the cookie.

  • Constructor Details

    • SignedCookie

      public SignedCookie(@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.