I'm confused with the walkthrough, how can I keep the user is logged in status? I tried to save it into
session['user_id'] = results['id']
But it doesn't work
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.Sign up to join this community
Do you mean in your
register route? I'd expect that you are running an INSERT statement to add the new user to your database.
db.execute will return on an INSERT will return the id of the row that was added, so you should be able to simply set the session's user_id to the return value of your INSERT call.