Callable Session
A callable session is a type of callable map. It can be created in the following ways.
❐ Copy
Once created you can use it as a function. The callable session will return the value of the key passed as an argument. If the key does not exist in the map, it will return undefined.
❐ Copy
data
Returns the entire session object.
❐ Copy
revisions
Returns the revisions object. The revisions object is a map that contains the name and revision where action is either or . The revisions object is used to track the changes made to the session in order to update the cookies.
❐ Copy
size
Returns the number of key/value pairs in the session. This is the same as the length property for arrays.
❐ Copy
clear()
Clears the session. This will remove all the keys and values from the session.
❐ Copy
delete()
Deletes the key/value pair from the session. If the key does not exist in the map, it will do nothing.
❐ Copy
entries()
Returns an iterator object that contains the key/value pairs for each element in the session.
❐ Copy
forEach()
Calls a function for each key/value pair in the session. The function is called with the value, key and the map itself as arguments.
❐ Copy
get()
Returns the value associated with the key. If the key does not exist in the map, it will return undefined.
❐ Copy
has()
Returns true if the key exists in the map, otherwise it will return false.
❐ Copy
keys()
Returns an iterator object that contains the keys for each element in the session.
❐ Copy
set()
Returns an iterator object that contains the keys for each element in the session.
❐ Copy
values()
Returns an iterator object that contains the values for each element in the session.
❐ Copy