added support for signed sessions. needs unit tests.