HARRISBURG — At the end of its session this week, the state House of Representatives’ two top leaders stood together to deliver this message to colleagues: Behave.

The gentle — but rare — public rebuke was prompted by a string of lawmakers’ igniting firestorms on social media in recent months. From a Philadelphia Democrat berating antiabortion protesters to a Central Pennsylvania Republican posing for a selfie with a man wearing the T-shirt of a group with ties to white supremacists, the issue of how lawmakers should behave on social media has been thrust front and center.

“There is no room for hate in any form in this chamber and even in our own lives,” Majority Leader Bryan Cutler (R., Lancaster) said on the House floor Wednesday. “The people of Pennsylvania expect better from us.”

Minority Leader Frank Dermody (D., Allegheny), who stood beside Cutler, offered similar advice. Gov. Tom Wolf echoed those sentiments Thursday: "In a time when too many are focused on advancing partisan politics, let’s remind everyone that Pennsylvania is focused on delivering for the people who we serve.”

Though none of the leaders singled out lawmakers, they didn’t have to. Lawmakers from both parties have provided a string of embarrassing posts, including several that have gone viral.

Democratic State Rep. Brian Sims of Philadelphia made national headlines after he posted videos of himself on Twitter and other platforms berating antiabortion protesters outside a Planned Parenthood clinic in his Center City district.

Within days, he found himself in a firestorm. Though Sims acknowledged that he was “aggressive” and pledged to “do better,” critics noted that he did not apologize.

State Rep. Stephanie Borowicz (R., Clinton) took a resolutely defiant stance after a progressive activist snapped a photo — then posted on Twitter — of the freshman lawmaker taking a selfie with a man who wore a T-shirt with the name of a group believed to have ties to white supremacists.

In a statement, Borowicz defended herself against what she called a “typical, calculated move" out of the “leftist playbook." The Anti-Defamation League called for her to apologize and condemn white supremacy. She did neither.

Democratic State Rep. Danielle Friel Otten of Chester County is among the few public officials in Pennsylvania to have issued a public apology, after a Twitter post comparing Sunoco pipeline workers to Nazis landed her in trouble.

Legislative officials acknowledge there are no guidelines on how to deal with such social media controversies.

House Democrats and Republicans have separate and detailed policies on computer and social media usage. They share many aspects, including directives that lawmakers (and, often, aides who have access to their public profiles) not engage in harassment, intimidation, or other offensive behavior.

The rules also explicitly prohibit campaigning on representatives’ official social media accounts. Violating the policy can result in sanctions.

Those lines become blurred when legislators create non-official accounts, where they make their line of work clear and openly discuss public policy. That was the case with Sims, for instance, whose Twitter account is not an official legislative one, but whose bio includes his state representative title. (He posted one of his videos on Facebook; others resurrected them on Twitter.)

In the Senate, policies tend to deal more generally with how legislators should conduct themselves, as well as how they and other employees should use taxpayer-funded computers.

Mike Straub, a spokesperson for House Republicans, said the chamber provides guidance, but cannot control statements that lawmakers make.

“Ultimately," said Straub, "the voters of their districts judge their actions.”