Hi, I'd like to help you with your question.
I am familiar with this problem. The issue with affairs and pornography is rarely obsessive behavior but rather esteem, self confidence and also fear based emotional behaviors. In many men, these emotions remain hidden and for the most part are taken out on their wives, through affairs, pornography and other self destructive behaviors. There is an emotional thrill associated with self destructive behaviors and that often affects the man's ability to stop. These become true addictions with both physical and emotional ties to the behavior. Simply stopping the behavior will not be enough for they will return unless healthier behaviors are designed to take their place.
To help solve this problem, you need to take steps to understand then free yourself from this issue. One, you must, under no circumstances have any type of contact with this other person. Your wife will not only see it as a betrayal, but you will undermine any recovery for yourself.
Two, understand where the behavior comes from. This is an emotional issue that must be addressed as such. Find out about your emotional need to pursue destructive behaviors and start working to replace the emotional issues with ones that are good for you and your marriage. A therapist, or if you attend church your pastor, could help you with this step. Attend with your wife but if she will not go, go alone. You need to resolve the root of this problem before you can move on and repair your marriage.
Three, there are two websites that I highly recommend. One is called Settingcaptivesfree.com and the other is Marriagetoday.org. Both of these have wonderful support for men and their wives to start working on your emotional issues and the relationship.
Work with your wife to rebuild trust. Be open about every thing. Tell her about the steps you are taking in recovery, any discoveries you make about why the behaviors occurred, and do what you can to be there for her. Account for your time away from her, not every minute, but enough where she is reassured that you are where you say you are going to be. Answer any questions she has about the affair, even if they are uncomfortable. This will rebuilt her trust and also make sure she is not left out of anything you experienced. Even though it is hard, it shares with her every part of what you are both going through and that will go a long way to helping to repair your relationship.
I hope this has helped you,