Export session utility functions

Other auth solutions will want to reuse these functions. These should
probably be moved to a separate auth utility module but this seems like
the most prudent course of action.

COUCHDB-2491