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[0]['id']

But it doesn't work


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .