Worried about your boss prying into your personal business, poking around in aspects of your life you'd rather keep between friends and family even as you share more of it on social media?

Seventeen states have drawn a line between what's your business and what your boss can access, by enacting laws that ban employers from asking for the logins and passwords to the personal social media, email and other online networking accounts of their workers and prospective hires.

Since Maryland passed the first ban two years ago after a state employee complained of having to reveal the password to his Facebook account, legislatures in states as politically different as Michigan and California, New Jersey and Utah, have passed laws that impose restrictions on snooping by government and private employers.

Louisiana, Oklahoma, Tennessee and Wisconsin approved laws this year, while Maine lawmakers voted to study restrictions. Similar legislation was introduced this year or is pending in more than 20 other states, according to the National Conference of State Legislatures.

Employers increasingly are concerned that what employees say in cyberspace could damage their businesses. Meanwhile, more workers are bringing their own smartphones and tablets into the office.

Sponsors of the legislation say the laws are needed to keep basic privacy rights apace with technology.

"Fifty years ago, if somebody brought in a stack of personal correspondence and put it in their locker, the employer wouldn't demand to see it," said Republican state Sen. Kyle Loveless, Senate sponsor of Oklahoma's law, which was signed in May. "In today's time, people put (personal correspondence) online. An employer shouldn't have the right to see it.

"I'm an employer, and as an employer I shouldn't have the right to demand that of an employee or a prospective employee," said Loveless, who operates a family orthopedic footwear business in Oklahoma City.

Like several states, Wisconsin's law also prohibits college and school administrators, coaches and teachers from demanding access to students' personal accounts.

Even many elementary school students have smartphones loaded with personal information, said state Rep. Melissa Sargent, a Democrat from Madison who sponsored the law in the Wisconsin Assembly.

A smartphone today, she said, is "akin to a scrapbook" in which previous generations kept baby pictures and postcards from grandparents. "Do you bring a scrapbook to a job interview? Do you bring it to school and let everyone see it?"

A case that helped initiate the flurry of laws was that of Robert Collins, a Maryland correctional supply officer who sought to return to work after taking family leave in 2010.

Collins told the Maryland House Economic Matters Committee two years ago that he was "mortified" when a hiring investigator asked to log into his Facebook account as part of his reinstatement interview. The investigator said he was concerned about any gang connections.

"I said, 'you can't be serious,'" Collins testified. "He said, 'I am as serious as a heart attack.' I did not want to do it, but because I really needed my job and he implied that this was a condition of recertification, I reluctantly gave him my password."

The privacy laws generally apply to state and local government as well as private-sector employers. Like Wisconsin, many states also include colleges, where coaches seek to control what athletes say. Arkansas and Delaware aim their laws at colleges.

Many states prohibit retaliation against employees who refuse to surrender their passwords. Some laws impose fines ranging from $500 to $1,000 for violations.

The laws reflect growing privacy concerns even as people are ramping up use of social media such as Facebook, which had about 160 million daily users in the U.S. and Canada in March, or Twitter, whose users send out an average of 115 million tweets a day in the U.S.

Seventy-three percent of American adults who go online use social media, a December survey by the Pew Research Center's Internet Project found. And 42 percent said they use more than one social networking site.

At the same time, 11 percent of Internet users say they've tried to hide their online activity from an employer, supervisor or co-workers, another Pew Research survey found in September. Nearly 70 percent said it was very important that only they or those they authorized had access to their emails. (Stateline is funded by Pew.)