Unfortunately for me I have this and it's something I have to live with, but this is also why I have gone for the self employed route as most employers don't understand it. Yes I could easily recall how to type in HTML and CSS because I've done it enough over the years, but even with Python even though I'm good at it, if put on the spot like I was for an interview I couldn't recall it.
I am the type of developer who has a book always near me or cheat-sheets to reference back to something I had written. Only way that I know is years in comparison so if you've been working with it long enough, you'll remember it but short term unless you're one of these personality's that have a photographic memory, it will take time.
I know for me its due to pressure and stress and being put on the spot that gets me, but there are a new generation of employers who will support you, i can only hope that you will find one of these :)