Reads authid from the class and checks if the session cache has a suitable item.
If found, the session is validated, the reference counter is increased and the
session id is returned. If a session fails validation, it is removed from the
cache. If no valid session is found, returns undef.
Expects the session information to store in the session cache as argument and
puts it into the sessioncache object using the class authid from the
class as index.
Existing items in the cache will be overwritten, passing
undef removes the cache item.
Returns the session information.
Detach this instance from the session cache and terminate the session in case
this is the last reference to it. The session can be passed as argument, in
case no argument or undef is passed, the session is read from the class
session method.