SACRAMENTO — Over protests from the tech lobby, California senators passed legislation on Thursday that would limit what information online retailers can collect from their customers.

Senate Bill 383 would still allow online merchants to log their credit card-paying customers’ billing addresses and ZIP codes, but only if they use that information to battle identity theft and fraud. Merchants would eventually have to delete that data, and they would not be allowed to sell it to third-party brokers.