Hi, I'd like to help you with your question.
It sounds like there could be a couple of things going on here. One, your wife maybe looking for a deeper connection with you in your marriage and did not know how to get it or she finds it difficult to feel close to you when you are together but being apart appeals to her.
Some people find relationships at a distance more appealing that being together. They like the control it brings and the emotional distance helps them feel less threatened. This may be why your wife flirts with you and feels better having contact with you when you are not together. She can control when she sees you and she can feel safer from a distance.
She may also want to be with you but feels at a loss on how to connect. There are many ways to put the spark back into your marriage. Here are some to try:
Connect on an emotional level everyday- leave notes, bring home surprise gifts, slip in a little sex before the day gets started or plan a date night.
Express how you feel more often- tell her she looks great even when she is in sweats, hug her just because, share something important with her.
Buy something special for her- like her favorite perfume or something she mentioned she'd like to have.
Watch a movie with her that only she likes- and make it special. Buy take out, set out roses and turn the light down low.
These are some ideas to try if she is willing. Try out one thing from the list and see how she reacts. If she still pulls away, back off and try again later. If she is still resistant, then you may need to tell her that you want to either keep trying or end the relationship all together. You don't want to get pulled into a game where she holds all the cards and you have to keep trying to win her back.
You can also try counseling again, if she is willing to go. You may need to try a new therapist if you feel your other one did not help as much as you needed. Also, try asking for referrals to increase the chance you'll find a therapist that can help. Your doctor may have a suggestion or you can search on line at http://therapists.psychologytoday.com/rms/.
I hope this has helped you,
If you found your answer helpful, please click the green ACCEPT button. I am not paid for my work unless you accept. Thank you!