Encode value to avoid Python3 errors. Refs #776
Always wrap openid session value
Fix encoding string between python2 and 3