Several new laws will impact California workplaces when they go into effect Jan. 1. The state legislature approved about 18 laws affecting issues ranging from social media to breastfeeding to wearing religious attire, according to the San Francisco Chronicle.

One measure prevents employers from requiring or asking employees and job applicants to disclose their user names and passwords for personal social media accounts. Employers also cannot ask an employee to access their social media account in the presence of the employer.

An exception to the law allows an employer to require social media credentials as part of an investigation into alleged employee misconduct or illegal activity. The social media credentials can be used only for purposes of that investigation.

California is the third state to enact such a measure, following Maryland and Illinois. Employment rights advocates say accessing a job applicant’s social media account allows a potential employer to learn information they are legally prohibited from asking about in an interview, such as an applicant’s age and marital status, or a physical condition such as pregnancy.

One new law extends existing prohibitions against gender-based discrimination to include discrimination based on breastfeeding. The law was passed after an employee was fired for nursing her infant during her meal break, according to The Monterey County Herald.

Another measure extends fair employment protections to an employee or applicant’s religious dress or grooming practices. The measure says employers must make reasonable accommodations for such practices, using the same framework for employees requesting accommodations for physical disabilities. The law was in part a response to allegations that Sikhs were denied employment as security guards and police because they would not remove their beards and head coverings.