Package google.registry.flows
Class CookieSessionMetadata
java.lang.Object
google.registry.flows.SessionMetadata
google.registry.flows.CookieSessionMetadata
A metadata class that saves the data directly in cookies.
Unlike HttpSessionMetadata
, this class does not rely on a session manager to translate
an opaque session cookie into the metadata. This means that the locality of the session manager
is irrelevant and as long as the client (the proxy) respects the Set-Cookie
headers and
sets the respective cookies in subsequent requests in a session, the metadata will be available
to all servers, not just the one that created the session.
The string representation of the metadata is saved in Base64 URL-safe format in a cookie named
SESSION_INFO
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from class google.registry.flows.SessionMetadata
URI_SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
protected static String
int
void
void
Invalidates the session.void
void
void
setRegistrarId
(String registrarId) void
setServiceExtensionUris
(Set<String> serviceExtensionUris) Methods inherited from class google.registry.flows.SessionMetadata
toString
-
Field Details
-
COOKIE_NAME
- See Also:
-
REGISTRAR_ID
- See Also:
-
SERVICE_EXTENSIONS
- See Also:
-
FAILED_LOGIN_ATTEMPTS
- See Also:
-
-
Constructor Details
-
CookieSessionMetadata
public CookieSessionMetadata(jakarta.servlet.http.HttpServletRequest request)
-
-
Method Details
-
invalidate
public void invalidate()Description copied from class:SessionMetadata
Invalidates the session. A new instance must be created after this for future sessions. Attempts to invoke methods of this class after this method has been called will throwIllegalStateException
.- Specified by:
invalidate
in classSessionMetadata
-
getRegistrarId
- Specified by:
getRegistrarId
in classSessionMetadata
-
getServiceExtensionUris
- Specified by:
getServiceExtensionUris
in classSessionMetadata
-
getFailedLoginAttempts
public int getFailedLoginAttempts()- Specified by:
getFailedLoginAttempts
in classSessionMetadata
-
setRegistrarId
- Specified by:
setRegistrarId
in classSessionMetadata
-
setServiceExtensionUris
- Specified by:
setServiceExtensionUris
in classSessionMetadata
-
incrementFailedLoginAttempts
public void incrementFailedLoginAttempts()- Specified by:
incrementFailedLoginAttempts
in classSessionMetadata
-
resetFailedLoginAttempts
public void resetFailedLoginAttempts()- Specified by:
resetFailedLoginAttempts
in classSessionMetadata
-
save
- Overrides:
save
in classSessionMetadata
-
encode
-
decode
-