Adapting a session plugin
=========================

All sessions have to provide the ISessionPlugin interface, which allows
them to be adapted to an ISessionSource:

  >>> from plone.session.interfaces import ISessionPlugin
  >>> session = self.folder.pas.session
  >>> ISessionPlugin.providedBy(session)
  True

The default plone.session configuration defines an adapter from ISessionPlugin
to the hash plugin:

  >>> from plone.session.interfaces import ISessionSource
  >>> source=ISessionSource(session)

Standard sources
================

A source is an object which manages session identifiers. They are used to
create session identifiers, verify them and extract user ids from them.

They are defined by ISessionSource, which implements just three simple methods.
The first one creates a string object which can be used to identify a users
session:

  >>> id=source.createIdentifier("johny.bravo")
  >>> isinstance(id, str)
  True

A source can verify if an identifier is valid:

  >>> source.verifyIdentifier(id)
  True

Finally we should be able to extract the original user id from the identifier:

  >>> source.extractUserId(id)
  'johny.bravo'

