SEATTLE (AP) — You can change your name, but in many states you can't completely shed your old one — something that's of particular concern to transgender people and that legislators in at least two states are trying to change.

A bill in Washington would allow gender expression and identity as reasons to seal, or keep out of the public record, a future petition for a name change. And a California bill would require the sealing of petitions by minors to change their name and gender on identity documents.

In states where such petitions aren't sealed, transgender people can be susceptible to cyberbullying or even physical violence because their previous names, and by extension their lives, are an open book in the public record, advocates warn. Students, for instance, can and do easily find and share such records when they are looking for background on a new kid in town, one advocate noted.

Maia Xiao, a University of Washington graduate student, has changed her name in that state and said the publication of a transgender friend's name-change records in an online forum led to relentless harassment, including hate mail. She wrote last summer to Democratic state Sen. Jamie Pedersen to urge reform.

"It feels very close to me," said Xiao, who would not disclose the name of her friend, citing privacy. "I don't live a very online life, but it's really scary to know that something so personal can be so easily accessed by transphobic trolls who want to cause harm."

Pedersen is sponsoring the Washington legislation, which passed the Senate this month with bipartisan support and is expected to also pass the House. The bill is modeled on laws in New York and Oregon and would also extend records privacy to refugees, emancipated minors and people who have been granted asylum.

Currently, only people subjected to domestic violence can have their name changes easily sealed in Washington. Some other states, including California, also make exceptions for victims of crimes like human trafficking, stalking and sexual assault.

"This seemed to me like a simple action that could go a long way in making transgender people a lot safer in our state," Pedersen said.

Some officials and law enforcement officers worry that criminals who request a name change could escape accountability under the proposals. The Washington bill would allow courts to unseal a name change file if law enforcement had reasonable suspicions, and sex offenders and incarcerated people would still be ineligible for a sealed name change.

"This is not the intent of the bill, and such cases would be rare, but there needs to be procedures in place to prevent it," Jennifer Wallace, executive director of the Washington Association of County Officials, said in an email.

The approaches in Washington and California contrast starkly with recent and mysterious moves in Florida and Texas to compile lists of trans residents using public records, and as lawmakers in at least 39 states consider a torrent of anti-trans bills.

Republicans' "disturbing" requests for data on transgender residents in some of those states add urgency to his proposal, Pedersen said.

The office of Texas Attorney General Ken Paxton last year requested data on how many people had changed the gender information on their driver's licenses. The Texas Department of Public Safety found over 16,000 gender changes during the prior two years but didn't turn over data because it could not determine the reason for each change.

In Florida, Gov. Ron DeSantis asked state universities last month for data on students who had sought or received treatments for gender dysphoria. Neither Paxton nor DeSantis explained why they requested the data.

Harassment from such disclosures can especially target young trans people who struggle with mental health issues or gender dysphoria, advocates say. The same internet forum that Xiao said had targeted her friend came under fire last year for instances of doxxing trans people, or maliciously publishing their personal information online, and has been linked to suicides.

Peers may search students' names as they move to a new middle or high school and can easily find and share court records related to their petitions for a name and gender change, said Kathie Moehlig, executive director of the San Diego nonprofit TransFamily Support Services. She approached California Assembly Speaker Pro Tem Chris Ward with the idea for the bill after students she advises brought the trend to her attention.

Many families with trans children aren't even aware such records are public, Moehlig said.

"Somebody's gender identity is an innate piece about them — it's intimate," she said. "They deserve the right to the privacy around their identity."

The California bill, which was introduced last month and has not yet been scheduled for a hearing, would require the state to seal any petition filed by a person under 18 for a change to gender and sex or to gender, sex and name in identity documents. Also sealed would be documents from a petitioner's court proceedings.

San Diego lawyer Clarice Barrelet, whose 11-year-old son is transgender, said simply plugging his name into a search engine shows his legal gender change.

He had insisted by age 6 that he should not be called a girl and would grow up to be a man, Barrelet said. He came out as transgender at age 8 and changed the name and pronouns he used in school, even before his mom petitioned the court for a legal change to his identity documents.

Barrelet said she thinks those records should be sealed for children and adults to better protect their privacy.

Ward, a San Diego County Democrat and vice chair of the California Legislative LGBTQ Caucus, said he hopes his bill will reduce the risk of bullying for gender-nonconforming children. He noted that being outed can be especially traumatic for young people who are still processing their identities.

"I want them to certainly be comfortable," Ward said, "and free to be themselves."