Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Grabs cookie and splits the first part to it's user_id from the datastore (Ex: 747474)
- user_id_cookie_str = user_cookie_str.split('|')[0]
- # Grabs cookie and splits the second part to it's hash from the datastre (Ex: fj78df87dd87d78)
- user_hash_cookie_str = user_cookie_str.split('|')[1]
- # Goes into User table selects the column password and checks to see if pass is equal to hash from the cookie
- get_username = db.GqlQuery("SELECT * FROM User WHERE id=:user_id and password = :user_pass",
- (user_id=user_id_cookie_str, user_pass=user_hash_cookie_str))
- # Fetches every data from the specific user
- if get_username.count():
- # Get users username and render the welcome page
- if get_username.get().username:
- username_from_db = get_username.get().username
- self.render("welcome.html", username=username_from_db)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement