The Gym Complex?

Long winded I'm sorry, just hoping to get some sort of answer about why I have such a mental struggle with this...

At the gym I feel strong and confident, I can look at my body and appreciate how it looks and functions and generally feel strong, sexy and capable of just about anything... I leave the gym with this lovely glow and a general contentment get in the car and drive home. By the time I get home I feel rather insecure and miserable, and by the end of my shower and having gotten changed I am loathing myself again, I can barely stand to look at myself and really struggle with very negative self talk...

What am I doing wrong that I have such a strong swings between the gym and all other aspects of my life? I want to bring with me at least some of my gym confidence and appreciation of my body to the rest of my life!!!