Place onion, corn cobs, and 2 quarts water in a medium saucepan. Bring to a boil over high heat and immediately reduce to a simmer. Let simmer for 45 minutes. Remove from heat and let cool. Strain, and use immediately or keep refrigerated in an airtight container for up to 1 week.