The fact the problem reverses, makes me think it's more likely to be the solenoid failing.

When the air is exhausting, remove the hose from the non-pressurised side of the cylinder (i.e if it's pressured into the spindle, remove the hose at the spindle end). If it's the cylinder that's leaking, then the air will escaping from the cylinder. If it's coming out the hose, or there's no change, then it's likely to be either the solenoid, or something lose/broken near the solenoid (I have seen the pressfit couplings simply fall apart and start leaking with age).
I'm not sure what machine you've got, but if it's a separate control box, the solenoids are all mounted in a box on the rear of the machine. I think if it's a machine with built in control box, then they're in the main control box.

If you do need a cylinder, I should still have a new one kicking around.