Module io.jooby
Package io.jooby

Class SessionToken.HeaderID

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

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

- find a token from a request header. - on save, send the header back as response header. - on session destroy. don't send response header back.

  • Constructor Details

    • HeaderID

      public HeaderID(@NonNull String name)
      Creates a new Header ID.
      Parameters:
      name - Header's name.
  • 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.