def CreateCookieData(email, admin):
 nickname = email.split('@')[0]
 if admin:
  app_list = os.environ['APPLICATION_ID']
 else:
  app_list = ''
 secret = os.environ['COOKIE_SECRET']
 hashed = sha.new((((email + nickname) + app_list) + secret)).hexdigest()
 return urllib.quote_plus('{0}:{1}:{2}:{3}'.format(email, nickname, app_list, hashed))

def CreateCookieData ( email , admin ) : nickname = email . split ( '@' ) [ 0 ] if admin : app_list = os . environ [ 'APPLICATION_ID' ] else : app_list = '' secret = os . environ [ 'COOKIE_SECRET' ] hashed = sha . new ( ( ( ( email + nickname ) + app_list ) + secret ) ) . hexdigest ( ) return urllib . quote_plus ( '{0}:{1}:{2}:{3}' . format ( email , nickname , app_list , hashed ) )
creates cookie payload data .