Guest User

Untitled

a guest
Oct 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. sessionid = hashlib.md5(user.encode('utf')).hexdigest()
  2. #generates the session id for the cookie
  3.  
  4. response = make_response(open('LoginPassed.xml').read())
  5. response.set_cookie('sessionid', sessionid)
  6.  
  7. for name in request.cookies:
  8.  
  9. #I am trying to get the value of a sessionid cookie to compare if that
  10. #hash matches with the hash value of the email sent
  11.  
  12. value = request.cookies.get('sessionid')
  13. items = value.items
  14.  
  15. for a, b in items:
  16.  
  17. if b == hashlib.md5(_email.encode('utf')).hexdigest():
  18.  
  19. response = make_response()
  20. response.headers['NewSession'] = 'new'
  21. return LoginPassed(name)
  22. return LoginError()
Add Comment
Please, Sign In to add comment