Package io.mangoo.routing.bindings
Class Session
java.lang.Object
io.mangoo.routing.bindings.Session
- Author:
- svenkubiak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the complete sessionstatic Sessioncreate()Retrieves a specific value from the sessionbooleanbooleanChecks if the session has at least one entryvoidInvalidates the session by sending expiring the client cookiebooleanvoidAdds a value to the session, overwriting an existing valuevoidRemoves a value with a given key from the sessionwithContent(Map<String, String> values) withExpires(LocalDateTime expires)
-
Constructor Details
-
Session
public Session()
-
-
Method Details
-
create
-
withContent
-
withExpires
-
invalidate
public void invalidate()Invalidates the session by sending expiring the client cookie -
hasContent
public boolean hasContent()Checks if the session has at least one entry- Returns:
- True if the session has at least one entry, false otherwise
-
get
Retrieves a specific value from the session- Parameters:
key- The key- Returns:
- The value or null if none present
-
getValues
- Returns:
- All values of the session
-
getExpires
- Returns:
- The expiry date of the session
-
put
Adds a value to the session, overwriting an existing value- Parameters:
key- The key to store the valuevalue- The value to store
-
remove
Removes a value with a given key from the session- Parameters:
key- The key to remove
-
clear
public void clear()Clears the complete session -
hasChanges
public boolean hasChanges()- Returns:
- True if a session values has change, be removed or the session has been cleared, false otherwise
-
isInvalid
public boolean isInvalid()
-