I need to know why it doesn't go to index.html.. Here's the code:
From the spec:
Finally, notice how login "remembers" that a user is logged in by storing his or her user_id, an INTEGER, in session. That way, any of this file’s routes can check which user, if any, is logged in.
Since the register function is not updating the session information, index doesn't know that a user is logged in, so re-routes back to login.