Hi TwistedNeck,
You need to ask yourself a very important question, one you may not like the answer to. Do you really love your SO? Or do you love how your SO makes you feel? There is a difference between actual love and love, which is dependent on what we take from the relationship.
Many (almost all) WS's tend to find themselves in the latter camp. You pretty much said it yourself... You feel lonely, rejected, and alone when he is not around, so you go looking to fill those empty spaces in yourself when he isn't around. And that's not love, that's need. You love him when he's around because he fulfills your needs, but when he's gone, there is no one to make you feel special and wanted, and it makes you desperate to the point where you step outside the relationship in order to feel better about yourself.
Here's the thing. Most emotionally healthy people are capable of self-love. That is to say, they don't need someone else to make them feel loved, feel special, or feel good about themselves in general. Sure, it's wonderful for them to have that extra love and attention coming in, but they don't NEED IT to feel whole, like a good person, or to feel valued and appreciated. They believe enough in themselves to fulfill their own needs. When their SO isn't around, they miss the PERSON who is gone, but they don't fall apart and feel unloved. They don't need the incoming flow of love; they miss the outflowing love they give to another person.
On the other hand, people such as you and me have trouble feeling special and worthy and loved unless there is a steady stream of love flowing in at all times. In other words, we only feel valued, respected, and loved when we receive that love from an outside source. We literally need other people to love us and tell us that we're great/special/funny/smart/talented/sexy because we can't feel those ways on our own. As long as someone else keeps the good vibes coming in, we're all good. But as soon as that influx of love and attention goes away, we feel empty. We feel alone. We feel worthless. We can't produce those feelings on our own, and if we lack an outside person to fill our needs, we turn to someone else to do it.
A friend once explained it to me like this. Imagine that you have a "love tank", much the same way a car has a gas tank. When your love tank is full, all is good. But some of us have a hole in our love tank, so unless the love keeps pouring in at a fast enough rate, our love tank starts to go empty. When someone such as your SO goes away, the love tank empties completely, and since you can't fill it yourself, you crash instead. You feel ugly, unwanted, unspecial. This is why instead of looking for a friend, you look for a "special friend", one who gives you the attention you need.
So what to do about this? Well, therapy is really the first step. Many WS's experience traumas in their life that leave us in this "broken" state. Maybe you were sexually molested as a child? Maybe your parents divorced. Maybe you were bullied. Maybe you were just ignored, or even something as simple as maybe your parents weren't able to teach you self-love. These are things you can discuss and discover with a therapist, and then take steps to learn how to fill those holes in yourself by yourself, without needing an external source of validation.
Let me be clear about something, however... as long as you are in this same state, you are a danger to your SO. Why? Because every time he goes away, you are going to fall to pieces and go looking for validation in places that you shouldn't. Notice how scary it seems to you to let go of these "other people" that you lean on when your SO is gone. That's not love. That's not a concern for your SO. That's all about you. And as long as things are all about you, they cannot, and will not, be about him. It's about need, not love, which is NOT FAIR TO HIM OR YOU. Unless you fix this, you will always have an open door to infidelity.
It took a lot of bravery, self-honesty, and integrity to reach out to us and realize that this is NOT who you want to be. That's a great start. I cannot tell you how many WS's come here in complete denial (such as myself when I got here 8+ years ago). If it were me, I'd start by seeing a therapist right away, just to help get a grip on why you are the way you are and what steps you can take to mitigate some of the problems. That's the easy part. The other part is that you need to talk to your SO as well. Look, I know how those words feel when said to you. It can feel terrifying, and it is. The truth is, if your SO was online talking up some hot babes while he was away, I think you'd want to know. And you'd want to have the dignity and respect to make some decisions for yourself about that. Your SO deserves those same things. He may be understanding and supportive. Or, he may be pissed off and leave. Either way, by telling him, you give him back his agency and show him that you care enough about him and yourself to be honest and willing to work through the hard stuff together. That's what a real relationship is based on - honesty, integrity, and respect.
I wish you the best. Please keep coming back.
Oh, and before I leave, please get your hands on a copy of the book "Not Just Friends." It will help you a lot to start understanding what's going on within yourself and what's happened so far.