??? How does this test that the user is logged it? I think you should check that the session is set to the correct id, or at least check that it is not nil.