adds generate_token method to session, fixes #12