The recent hacking of Ashley Madison brought into public light a societal taboo that typically stays behind the closed doors of cheap motels and in the records of many a divorce—extramarital affairs.

While it is no secret that cheating happens, the numbers that came out of the potential data breach on the now infamous adultery site (Ashley Madison claimed more than 37 million users could have been compromised) clearly demonstrates that the prevalence of married individuals seeking affairs is likely far greater than many would imagine.

And even though the breach thus far has essentially boiled down to an opportunity for spammers to spread malware, the initial hype over what it could potentially mean for millions of married adulterers to be singled out is a good opportunity to explain the significance of what cheating can do to a marriage and the financial consequences—both direct and indirect—when many of these marriages come to an end.

In my experience as a divorce attorney, adultery is a factor in a substantial majority of cases, and in many states, marital misconduct such as adultery can be considered with respect to a number of factors in the settlement.

A spouse that is conclusively found to be guilty of committing an extramarital affair may be required to pay a portion or all of the opposing party’s attorney fees. In some states, such as South Carolina, adultery can be an absolute bar to receiving alimony even if you would be entitled to support otherwise. Infidelity can also impact the equitable distribution of assets depending on your state’s law.

While these are a few examples of how an affair can explicitly impact a divorce settlement, the rise of no-fault divorce has led to an often diminished direct impact of infidelity on divorce proceedings. An increasing number of states have enacted laws that attempt to remove blame from the equation and create a less contentious process, which often makes it easier to negotiate a settlement.

This does not mean, however, that infidelity is completely removed from affecting the outcome in even the strictest of no-fault divorce states.

The largest impact of having an affair come to light in a divorce often has little to do with statutes and case law, but in its ability to influence the mind of the court. The nature of family court gives far more discretion to the judge than arguably any other area of law, meaning there is often very little concrete criteria for a judge to employ when making a ruling.

Aside from something like child support, which typically has a fairly straightforward formula, a judge is free to interpret the majority of his or her rulings how they see fit. In equitable distribution states for example, there are generally a set of loose guidelines for a judge to use when it comes to determining the division of assets, but it essentially comes down to what the judge thinks is an “equitable” settlement.

This is also true for maintenance awards and attorney fees, so when evidence of an affair arises during a divorce, there is a good chance it will play a role in the judge’s decisions when it comes to these factors that have potentially substantial financial ramifications.

Every divorce attorney knows how important it is to present the right image of their client to the judge, and it will do nothing but help your cause if you are able to cast a negative light on the opposing party. So if the opposing party has committed an affair, any good divorce attorney will be able to get that information in front of the judge whether that evidence will have a direct impact on the matters at hand or not.

A client’s moral character can be a major factor in many aspects of a divorce settlement due to the broad range of discretion a judge wields in court.

Whether a judge consciously determines a party’s affair has flagrantly broken the vows of their marriage or the affair merely affects the court proceedings on a subconscious level, it is a safe bet that judge will not be lenient when it comes to the property settlement, alimony award or other factors he or she has control over.

This is particularly important to keep in mind since it is notoriously difficult to overturn a divorce ruling because of the discretion allowed to family court judges. That brief tryst may have seemed worth it at the time, but it could end up turning into an unusually high (but within the bounds of law) alimony obligation and lopsided property settlement that will continue to affect you financially for the rest of your life.

With the advent of the Internet, it is easier now than ever before to step outside the boundaries of marriage and engage in an extramarital affair. However, these have a tendency to be discovered one way or another and the ramifications stretch far beyond simply ruining a marriage.

According to the slogan of Ashley Madison, “Life is short. Have an affair.” The first half of that statement is certainly true, but is life really short enough to risk the consequences of an affair in the long run?

Joseph E. Cordell is the principal partner of Cordell & Cordell, a domestic litigation firm focused on representing men in divorce. Since co-founding the firm with his wife, Yvonne, in 1990, he and his team of almost 200 attorneys spread across more than 100 offices in 29 states and the United Kingdom have helped tens of thousands of men going through divorce.