<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_logged_in_user():
 """If a user id is stored in the session, load the user object from the database into ``g.user``."""

    user_id = session.get("user_id")
    g.user = User.query.get(user_id) if user_id is not None else None