Difficulty shifting out of park on 2004 Acura TL

I have an automatic transmission and within the last few days when I get into the car and start it up and try to put the car into reverse it doesn't work. I have to depress the brake a few times or have popped open that little door on the shift area and unlocked it. Why is this happening? By the way, it happens more if the engine is cold like first thing in the morning or at the end of the work day. If you shut it off and start it up again within a short period of time it shifts out of park. I don't get it!

Asked by for the 2004 Acura TL
I've seen dust and debris get in the solenoid at the shift lever. Do you hear a click when you press the brake pedal, key in run position. System needs brake light switch input. the yellow/ red at the solenoid should have 12 volts in the run position ignition switch (7.5 Amp fuse number 32), black wire gets grounded by the computer to allow solenoid to operate.