SACRAMENTO, Calif. (AP) — California is looking to tighten the rules about children under 13 using social media.

The state Senate voted 31-4 on Thursday to require social media companies to first get the consent of a parent or guardian before creating an account for a child the company knows is under 13.

RELATED: Friends with benefits: Can Facebook tackle your love life?

Federal law already requires social media companies to get parental consent before collecting or selling data of children under 13. That's why most social media companies, including Facebook, already ban children under 13 from creating accounts.

Democratic Sen. Henry Stern says the bill will protect children. But Democratic Sen. Scott Wiener says the bill would harm LGBT youth who live in abusive households by isolating them from others like them.

The bill now heads to the state Assembly.