Cover only protects against ranged attacks from the covered direction. Enemies who reach melee range ignore your cover.