Allow user to pass in method to call when the session expires.

Fixes #1.