Like other vegetables, onions don't last forever. They don't, however, go bad overnight. If you've used only part of an onion for a recipe, you don't need to throw away the leftovers for fear of them turning toxic. Instead, simply wrapping and storing them properly can ensure that they last for an additional week, or even longer.
Safely Storing an Onion
Despite urban legend, onions do not turn toxic overnight after they are cut. Similar to other fruits and vegetables, though, a cut onion shouldn't be left out on the counter overnight, simply because the warm temperature and open air make it spoil faster. To make onion leftovers last, wrap them tightly in plastic or seal them in an airtight container, then store them in a refrigerator kept below 40 degrees Fahrenheit. Your leftovers will stay good for as long as 10 more days.