Connecting to a public Wi-Fi network can put you at risk. Here’s how to minimize the damage.