Evidentemente questa

<%if len(Session("aperta")) > 0 then

non è verificata....

Roby