[EXT-283] Added back the cookie removal and cleaned up the new code for token stuff