You can get close with a built in browser setting. Firefox can erase all cookies as soon as you close the browser:
https://support.mozilla.org/en-US/kb/enable-and-disable-cook...
You can also open up a Private Browsing tab if you want to visit a site you don't trust, or simply maintain a separate environment from your main stuff. Private windows have their own cookie store separate from the main store, and also clear their history upon close.