adds generate token to session and tests, fixes #25