The basic strategy uses a cocaine vaccine to coax the immune system into generating specific antibodies that would bind the drug while it is still in the bloodstream and prevent it from entering the brain.
http://www.drugabuse.gov/news-events/latest-science/cocaine-vaccine-stops-cocaine-in-its-tracks