The bill clears the way for consumers to sue responsible parties for actual damages, said state Sen. Kevin Murray, a Democrat who introduced the legislation in February.
Critics of the bill said it lacked teeth.
, which users have unknowingly accepted while downloading online games or using such sites as online music-swapping service Kazaa, can be difficult to remove and may cause computers to run slowly or crash.
More malicious programs, credit card information and other potentially valuable personal information. A variant referred to as "malware" is able to send viruses.
"When you tell people what spyware does, they're just incensed," Murray said in an interview.
Among other things, the new bill prohibits the use of keystroke logging to collect personally identifiable information and the collection of Web browsing histories.
It also bans software that takes control of a user's computer to send unauthorized e-mails or viruses. Computer code that modifies security settings also runs afoul of the new legislation.
"I think it's a piece of junk," spyware expert Ben Edelman said of the California bill, which he dubbed "the most superfluous of all legislation."
Several U.S. states are working on anti-spyware legislation while U.S. lawmakers work on their own bills.
Meanwhile, the Utah Spyware Control Act passed to combat spyware isof its constitutionality.