This function simply checks if req.session exists. This is not correct, as web applications may keep session data for non-authenticated visitors.