I think you mistyped this:  it should be session.logged_in