Fix EZP-22414: Session is lost when redirecting from a legacy module