I had this happen to me several times quite a few years ago.
My first line was to politely point out that it was against the rules and that I did not wish to endure it either.
If that didn't work, I would get out of my seat and go down to the back galley, leaving instructions to call me when he had finished and the cockpit was smoke-free. I would do this at any stage of flight.